Community Patterns

Community Library Entry

1

Regular Expression
Created·2025-04-20 09:45
Updated·2025-04-20 09:49
Flavor·.NET 7.0 (C#)

@"
(?mnxs-i) ^ (?!$) (?<Thousands> M{0,3} ) (?<Hundreds> ( (C(M|D)) (?!C) | D )? C{0,3} ) (?<Tens> ( (X(C|L)) (?!X) | L )? X{0,3} ) (?<Ones> ( (I(X|V)) (?!I) | V )? I{0,3} ) $
"
gmnxs
Open regex in editor

Description

This regex matches every allowed roman numeral allowed under the traditional system. This system ended at 3999, as this was the biggest expressable number without additional symbols or notation.

Submitted by Ben