Search code examples
javaregexroman-numerals

Regex matching punctuation and roman in lowercase


Possible Duplicate:
How do you match only valid roman numerals with a regular expression?

Hi,

How do I match regex to something like

[i])
[ii])
[iii])
[iv])

and so on...

Thanks


Solution

  • /^\[[ivmcldx]+\])/
    

    should catch the most common roman numerals. It won't stumble on invalid numerals like iiix, though.