.NET Regex Explainer

Paste a regular expression and get a plain-English breakdown piece by piece, with .NET-specific constructs like balancing groups and inline options called out, plus a live tester and a RegexOptions reference.

Examples

The tester runs your browser's JavaScript engine, which agrees with .NET on everything above except the constructs flagged in the notes. Nothing you type leaves this page.

RegexOptions, in one breath

IgnoreCaseCase-insensitive matching. Inline: (?i)
Multiline^ and $ also match at line breaks. Inline: (?m)
Singleline. matches newlines too. Inline: (?s)
ExplicitCapturePlain (…) stops capturing; only named groups capture. Inline: (?n)
IgnorePatternWhitespaceWhitespace in the pattern is ignored and # starts a comment. Inline: (?x)
CompiledCompiles to IL for faster repeated use; slower to build, no inline form.
NonBacktracking.NET 7+: linear-time matching, immune to catastrophic backtracking; no lookarounds or backreferences.
RightToLeftThe scan moves right to left. No JavaScript equivalent.

Always pair a user-facing regex with RegexOptions.NonBacktracking or a matchTimeout - a backtracking pattern on hostile input is a denial of service waiting for a string.