On Sat, 26 Oct 2002, iudicium ferat wrote:

> Based upon what I have read, you will likely need to do something 
> specific, manually...

> http://www.novaroma.org/via_romana/numbers.html

Hmm, at least the calculator on that page accepts things like IM and CMCM
that in my understanding are not well formed. I would try 

/\b
   (M+|(?=[CDXLVI]))
   (C{1,4}|CD|DC{0,4}|CM|(?=[XLVI])|(?<=M))
   (X{1,4}|XL|LX{0,4}|XC|(?=[VI])|(?<=[MCD]))
   (I{1,4}|IV|VI{0,4}|IX|(?<=[MCDLX]))
\b/x

The hard part is not to match the empty string. It would be much
easier if the roman numeral '' for were also allowed to match but from
your application this is  probably not what you want. If you don't
like numbers like VIIII (I have seen those on houses) because you
think this should rather be written as IX s/4/3/g above.

Robert

-- 
..oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling     Department of Applied Mathematics and Theoretical Physics
                      University of Cambridge
print "Just another   Phone: +44/1223/766870
    stupid .sig\n";   http://www.aei-potsdam.mpg.de/~helling

Reply via email to