Regular Expressions 101

Community Library

Community Library Entry

4

Regular ExpressionOpen Workspace

/
^(M{0,3})(C(?:D|M)|D?C{0,3})(X(?:L|C)|L?X{0,3})(I(?:V|X)|V?I{0,3})$
/

Description
Created·2015-07-11 18:42
Type·Match
Flavor·PCRE (Legacy)

Detects valid Roman numerals (up to 3999), and splits into 4 capture groups: thousands, hundreds, tens, and units.

Submitted by Terence Linnell
Open Workspace