More > JRiver Media Center 27 for Mac
Library field and how to trim a field -> get a tex from a multi value field
zybex:
Here's another solution with regex: capture anything except ";" (skips non-matching list entries) that is followed by " (orchestra)". This one works better if there's more than one Orchestra listed in the field:
Regex([Performer],/#([^;]+)(?= \([Oo]rchestra\))#/,-2)
or
Regex(listgrep([Performer], /(orchestra), /#([^;]+) \(#/, -2)
wer:
I'd forgotten ListGrep!
You don't need the regex to remove the (orchestra) part; just split it on the ( with listitem and the even numbered items will be the values (starting with zero).
zybex:
--- Quote from: wer on December 22, 2020, 02:03:39 pm ---You don't need the regex to remove the (orchestra) part; just split it on the ( with listitem and the even numbered items will be the values (starting with zero).
--- End quote ---
True, but might fail on entries with extra parens like "Some guy (and his mother) (orchestra)"
henning65:
@zybex: that is very helpful - Thank you
@wer: your advice was very helpful - learned a lot!
To extract the Orchestra I took:
Regex([PERFORMER],/#([^;]+)(?= \([Oo]rchestra\))#/,-2)&datatype="list"
I added datatype="list"
I created another custom field for choir:
Regex([PERFORMER],/#([^;]+)(?= \([Cc]hoir vocals\))#/,-2)&datatype="list"
Now - in the last step I try to get the solists from the list PERFORMER (that's still not perfect - but close enough). To do so, I try to calculate a custom MC library field SOLIST. With SOLIST=PERFORMER-CHOIR-ORCHESTRA-composer-conductor (this four "artists" have their own categories now - that's why I like to eliminate them here.
I tried to work with "?!" and with "^", but still can't get the function working. I would be happy, if you could give me an idea of how to formulate the expression correctly.
Thanks for helping!
zybex:
Using the negative lookhead "?!", capture all except ";" which is NOT followed by orchestra/choir/conductor/composer:
Regex([Performer],/#([^;]+) \((?!orchestra|choir|conductor|composer)#/,-2)
Edit: looks like Regex mode -2 is not case sensitive - no need for [Oo]
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version