i have added:
RxSplit(<field>,regex,index)
RxReplace(<field>,regex,replace-text)
note that replace-text can be literals or substitutions: https://msdn.microsoft.com/en-us/library/ewy2t5e0(v=vs.110).aspx
http://musicbee.niblseed.com/V3_1/MusicBee31_Patched.zip
That's great!
But.... I'm not sure I understand the working/syntax yet though.
Could you (or somebody else who is already getting this) perhaps give two quick examples of this would look like in real-life?
For example on a <Title> being:
"John ft. Mary (live)"
One example for what the virtual tag would look like if you want to have the output being just: (live)
and another one for what it would look like if you would want to only replace 'ft.' by 'feat.'
For (live), wouldn't the regex be (the terminal $ might be redundant, so it can be omitted)
Return code
For Foo ft Foo -> Foo (feat. Foo)
(^.*)([Ff]eaturing|[Ff]t\.|Feat\.)(.*$)
Return code
For simply ft. (or Ft.) -> feat.
Return code
On a side note, I held my tongue on this wishlist thread since nothing happened (for some reason or another I'm not privy to) the last few times I made this request. I just hoped that it would be incorporated finally and it appears that Steven did it. I'm glad to see MB incorporating this feature and I'm looking forward to playing around with it.
Early teething problems with $rxreplace. The following code variations disappear after hitting save despite MB validating them as "OK".
$RxReplace(<Title>,"(^.*?)(\: )(.*$)",$3)
$RxReplace(<Title>,(^.*?)(\: )(.*$),$3)
Below returns the following, doesn't work and disappears when trying to use it in the thumbnail browser: $RxReplace(<Title>,""("^.*?")""("\:" "")""(".*"$"")"","$3")
$RxReplace(<Title>,"(^.*?)(\: )(.*$)","$3")
Could you (or somebody else who is already getting this) perhaps give two quick examples of this would look like in real-life?
For example on a <Title> being:
"John ft. Mary (live)"
One example for what the virtual tag would look like if you want to have the output being just: (live)
and another one for what it would look like if you would want to only replace 'ft.' by 'feat.'
I am not getting it. Stevens post mentions 'index', you have an entry that you call 'return code', I think I'm on a wrong path here.
Could you perhaps post a screenshot of how this should look in the virtual tag's edit panel?
Sorry about the confusion. You're right, my "return code" is Steven's "replace-text". Okay, after getting a handle on the formatting, your virtualtags should go something like this:
Title (Live) > (Live)
$RxReplace(<Title>,"(^.*)(\([Ll]ive\))","$2")
Ft. (or Feat.) > feat. (note: you should probably do an if-contains first, like if the <title> contains ft. or Feat., then do below, else <title>)
$RxReplace(<Title>,"(^.*)([Ff]t\.|Feat\.)(.*$)","$1\(feat\.$3\)")
Early teething problems with $rxreplace. The following code variations disappear after hitting save despite MB validating them as "OK".
$RxReplace(<Title>,"(^.+?)(\: )(.*$)",$3)
there are two bugs. The parser should insist $3 is surrounded by quotes and when saving the quoting is not working correctly. Both should be fixed:
http://musicbee.niblseed.com/V3_1/MusicBee31_Patched.zip
Ok, it appears to work now, thanks! :D
I have a quick question regarding the encapsulating quotation marks. Would they have to be escaped in a regex formula? Something like this?
$RxReplace(<Title>,"(^.*)(\".*?\")(\:\s)(.*$)","$1\($2\)$3$4")