in reply to Re: regular expression
in thread regular expression
Possibly even better than [a-zA-Z], which makes a limiting assumption about the alphabet being used, one could use \p{Alpha}, which accepts 102159 different code points, all of which may be considered part of the alphabet of some language somewhere at some time, and none of which include numeric digits.
Instead of I+, how about using Regexp::Common's $RE{num}{roman} pattern, which will correctly match roman numerals, case insensitively. Here's the pattern it uses to do so:
(?xi)(?=[MDCLXVI]) (?:M{0,3} (D?C{0,3}|CD|CM)? (L?X{0,3}|XL|XC)? (V?I{0,3}|IV|IX)?)
Dave
|
|---|