Help - Search - Members - Calendar
Full Version: Roman Numerals case conversion
Mp3tag Forums > Mp3tag - International > Support
sminc
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

QUOTE
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
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
QUOTE (dano @ Oct 2 2007, 00:01) *
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.


Dano, am I correct in assuming that should be replace (^|\\W) with \\b ?
DetlevD
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
egd I've updated the expression in the thread.
chrisjj
QUOTE
when $upper gets a parameter with a comma it takes it as seperator and not as string.
Yuk. Especially as $upper has nothing to separate, being a single-parameter function.

Thanks for that info, Dano.
QUOTE
If you replace at the begining (^|\W) by \b it should avoid this bug.
What's \b ? Not mentioned in the Help, AFAICS.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.