More > JRiver Media Center 29 for Mac
please help with regex
HaWi:
--- Quote from: zybex on May 05, 2022, 10:44:24 am ---Well yesterday I was looking at your dash and thinking "is he using em-dash? Oh well, who cares" ;D
Here's one that works with both - take care to copy/paste it, that's an em-dash in there:
--- Code: ---regex([_tmp],/#[-–]\s*([^;$]+)#/,-2)
--- End code ---
There's a standard regex class that would capture all kinds of dashes but MC doesn't seem to support named classes. It would be so:
regex([_tmp],/#\p{Pd}\s*([^;$]+)#/,-2)
EDIT: If you want to allow hyphened names and only split on "space+[em]dash+space", you can use this one:
--- Code: ---regex([_tmp],/# [-–] ([^;$]+)#/,-2)
--- End code ---
--- End quote ---
Wow, this is amazing. I am bowing in front of the master. Thank you so much, Zybex!
EDIT: naturally, needed to replace the [_tmp] with [Soloists] (you are testing me ;D ) and it works as a charm. Thanks again so much, Zybex!
zybex:
--- Quote from: HaWi on May 05, 2022, 12:10:08 pm ---Wow, this is amazing. I am bowing in front of the master. Thank you so much, Zybex!
EDIT: naturally, needed to replace the [_tmp] with [Soloists] (you are testing me ;D ) and it works as a charm. Thanks again so much, Zybex!
--- End quote ---
Oops ::)
That's from testing with Zelda using a temp field, I forgot to edit it after pasting here.
You're welcome.
HaWi:
--- Quote from: zybex on May 06, 2022, 02:30:03 am ---Oops ::)
That's from testing with Zelda using a temp field, I forgot to edit it after pasting here.
You're welcome.
--- End quote ---
For a split second there I thought it was some high level regex magic ::) but then it clicked that it was a test field.
I really appreciate your help
Navigation
[0] Message Index
[*] Previous page
Go to full version