INTERACT FORUM
More => Old Versions => JRiver Media Center 31 for Windows => Topic started by: SkGe on January 22, 2024, 12:54:17 pm
-
it is possible to capture some contextual text from a description? An example is:
In 2015, Bergling released his second studio album, Stories, and in 2017 he released an EP, Avīci (01).[7] His catalog also included the singles "I Could Be the One" with Nicky Romero, "You Make Me", "X You", "Hey Brother", "Addicted to You", "The Days", "The Nights", "Waiting for Love", "Without You", and "Lonely Together". Bergling was nominated for a Grammy Award for his work on "Sunshine" with David Guetta in 2012[8] and "Levels" in 2013. Several music publications credit Bergling as among the DJs who ushered electronic music into Top 40 radio in the early 2010s.
.
Source wikipedia
I want to capture what inside those "You Make Me". I have one expression with replace() but everytime when it doesn't match with my replace() it doesn't count.
-
Capture string within quotes?
regex([_text],/#"(.+?)"#/,-2)
-
@Zybex. This capture those text inside the "", which is good. But wow about if I want to keep those text captured text inside the description and let say give them a different color?
Ex:
In 2015, Bergling released his second studio album, Stories, and in 2017 he released an EP, Avīci (01).[7] His catalog also included the singles "I Could Be the One" with Nicky Romero, "You Make Me", "X You", "Hey Brother", "Addicted to You", "The Days", "The Nights", "Waiting for Love", "Without You", and "Lonely Together". Bergling was nominated for a Grammy Award for his work on "Sunshine" with David Guetta in 2012[8] and "Levels" in 2013. Several music publications credit Bergling as among the DJs who ushered electronic music into Top 40 radio in the early 2010s.
-
I'm experimenting with some expression, and so far I have something like:
replace(replace(replace(replace([wik artist description],regex([wik artist description], /#(\"\W\B)#/, 1),}),regex([wik artist description], /#(\s\")#/, 1),/ {),{,<b>),},<//b>)
But the moment it match a space after" it messing all after.
-
One solution
just to my testing:
Save(/#In 2015, Bergling released his second studio album, Stories, and in 2017 he released an EP, Avīci (01).[7] His catalog also included the singles "I Could Be the One" with Nicky Romero, "You Make Me", "X You", "Hey Brother", "Addicted to You", "The Days", "The Nights", "Waiting for Love", "Without You", and "Lonely Together". Bergling was nominated for a Grammy Award for his work on "Sunshine" with David Guetta in 2012[8] and "Levels" in 2013. Several music publications credit Bergling as among the DJs who ushered electronic music into Top 40 radio in the early 2010s.#/, v_test)
[v_test]
actual expression. use [wik artist description] instead of [v_test]
Replace(Replace(ListMix(If(Math([N] % 2),[L1],"<font color="ff33ff">[L1]<//font>"),8,replace(Replace([v_test],;,__),",;)),;,/ ),__,;)
-
@Lepa 👍
-
Nice! I was playing with it and reached pretty much the same expression, just with a different separator than __ :)
The Compare() is not needed, as any expression that returns 1 will satisfy the IF condition:
If(Math([N] % 2),[L1], ...
-
The Compare() is not needed, as any expression that returns 1 will satisfy the IF condition:
Correct. Had some problems with listmix capture so put that there as safety when I was testing expression. probably that mode=8 wasn't somehow activated in the zelda at that time
-
One more Replace() to fix some spacing issues (Listmix removes spaces between elements):
replace(replace(replace(listmix(if(math([N]%2),[L1], "<font color="FF0000">[L1]<//font>"), 8, replace(replace([v_test],;,@@),",&&;&&)),;,),&&,),@@,;)
-
perfect!
-
Thanks guys :)
(https://i.gyazo.com/dffdb22c9e250777e1c81ec1e5d681ed.png)
My old and probably obsolete expression it was... no where near to yours.
<font face="titillium web"size="95">trimlines(if(isempty([wik album description]),,trimlines(replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(listitem([wik album description], 0, /[ ), / 10"/ , / 10"/ ), / "..., {...), / 12"/ , / 12"/ ), /;", }/;), (/"', (/{'), / "', / {'), "//", {//}), :", }:), "/), }/)), "/, , }/,/ ), "/)/,, }/)/,),/)", }/)/ ), ";, }/;), /,", }/, ), "/., }/./ ), /.", }/. ), /"?, }/?), /"!, }/!), /!", }/!), "/ , }/ ), /";, }/;), /"-, }/-), "', }/'), /":, }/:), ", {), /(", (/{), (/", {), '/,"/ , '/,}/ ), / ",/ {), / (", / /{), "/), }/)), "/ , }/ ), 17} , 17"), 7} , 7"), 5'9}., 5'9".), "'s, {'s), {,<b>), }, <//b>), 12}, 12/"), <b>, <font color="2184C6">), <//b>, <//font> )
, 2)),1)<//font>
-
Use the last iteration from zybex to get rid of extra spaces after closing " in some cases