sminc
October 1, 2007, 8:47am
1
I'm using the regex example to convert roman numerals to upper case but I'm having a problem with it.
For some reason it is deleting commas out of the tag / filename / directory which makes no sense as the only replace command is the $upper
The suggested regex is
Upper case for Roman numbers
Regular expression:
(^|\W)(?:M{0,3})(?:D?C{0,3}|C[DM])(?:L?X{0,3}|X[LC])(?:V?I{0,3}|I[VX])(?=(.\s|\s|)|$))
Replace matches with:
$upper($0)
case-sensitive comparison
Is there something in here where the comma is being selected but the $upper fails so it is being replaced with nothing ?
dano
October 1, 2007, 12:01pm
2
The problem is when $upper gets a parameter with a comma it takes it as seperator and not as string.
If you replace at the begining (^|\W) by \b it should avoid this bug.
egd
May 9, 2008, 7:25pm
3
Dano, am I correct in assuming that should be replace (^|\W) with \b ?
If you write a regular expression, which contains a syntactical correct comma in the search string, within Mp3tag $regexp() function you have to escape the comma with apostrophes, because the comma is the delimiter character in Mp3tag scripting language that separates the parameters in a parameterlist.
DD.20080510.0827.CEST
dano
May 10, 2008, 6:26am
5
egd I've updated the expression in the thread.
Yuk. Especially as $upper has nothing to separate, being a single-parameter function.
Thanks for that info, Dano.
What's \b ? Not mentioned in the Help, AFAICS.