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,641
  • 10
  • 36
  • 53

1 Answers1

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

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

Marc B
  • 348,685
  • 41
  • 398
  • 480