3

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

Community
  • 1
  • 1
y2p
  • 4,791
  • 10
  • 40
  • 56

1 Answers1

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

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

Marc B
  • 356,200
  • 43
  • 426
  • 500