According to Dr. Math

* I, X, C, and M cannot be repeated more than 3 times.
* V, L and D cannot be repeated.
* numerals are in descending order left to right except for in the
  pairs IV, IX, XL, XC, CD, CM ie. /i[xv]/, /x[cl]/, /c[dm]/
* Roman numbers are made by concatenating roman number representing
  individual digits in a decimal number

# 1000s       100s             10s              1s       #

might one such regexp that matches iff $_ is a roman numeral.

This turns out to be exactly the same regular expression that is used by from CPAN to decide if a string isroman. 

Offcourse it also matches some english words such as "mix" and proper
names like Vi.  Running it against dict/words and the moby word list found 
these to be the only cases though.


Bart Lateur <[EMAIL PROTECTED]> writes:

> Can someone come up with a (nice) regex that matches only Roman
> numerals?
> I'm trying to include proper case conversion to title case in a script,
> and it should turn a movie title like "HALLOWEEN II" into "Halloween
> II", not "Halloween Ii".
> -- 
>       Bart.

Jasvir Nagra
echo [91PP93P[dx]P]dx|dc

Reply via email to