.NET Regex Tester
Test C# regular expressions on the real .NET System.Text.RegularExpressions engine.
It runs in your browser with WebAssembly, so your patterns and test data never leave your browser.
Runs locally
Regex tester input
Test strings
Ctrl + Enter runs
One test per line; each line is matched on its own. The gutter shows the matches per line.
Loading the .NET regex engine… Downloading the WebAssembly runtime. The controls unlock when it's ready.
.NET ยท WASM
Matches 0 Split 0 Table 0 Groups 0 Replace 0
.NET regex quick reference
Click a token to insert it at the cursor; substitutions go into the replacement field.
Character classes
.
Any character except \n (any character with Singleline) \d
Digit (any Unicode decimal digit unless ECMAScript) \D
Not a digit \w
Word character \W
Not a word character \s
Whitespace \S
Not whitespace [abc]
Any of a, b, c [^abc]
Anything except a, b, c [a-z]
Character range [a-z-[aeiou]]
Class subtraction: consonants only \p{Lu}
Unicode category or block, e.g. \p{IsCyrillic} Anchors
^
Start of input, or of each line with Multiline $
End of input or line (also before a final \n) \A
Start of input only \z
End of input only \Z
End of input or before a final \n \b
Word boundary \B
Not a word boundary \G
Where the previous match ended Quantifiers
*
0 or more +
1 or more ?
0 or 1 {3}
Exactly 3 {2,}
2 or more {2,5}
Between 2 and 5 *?
0 or more, lazy (as few as possible) +?
1 or more, lazy ??
0 or 1, lazy Groups and lookarounds
(...)
Numbered capturing group (?<name>...)
Named capturing group (?:...)
Non-capturing group (?>...)
Atomic group (no backtracking into it) (?=...)
Positive lookahead (?!...)
Negative lookahead (?<=...)
Positive lookbehind (?<!...)
Negative lookbehind \1
Backreference to group 1 \k<name>
Backreference to a named group (?<open-close>...)
Balancing group, for nested constructs a|b
Alternation: a or b (?(name)yes|no)
Conditional: yes if the group matched Inline options
(?i)
IgnoreCase from here on (?m)
Multiline from here on (?s)
Singleline from here on (?n)
ExplicitCapture from here on (?x)
IgnorePatternWhitespace from here on (?i:...)
Option for this group only (?-i)
Turn an option off Substitutions (Replace)
$1
Text of group 1 ${name}
Text of a named group $0
The whole match $&
The whole match $`
Input before the match $'
Input after the match $+
The last captured group $_
The entire input $$
A literal $ Escapes
\.
Literal . (escape any metacharacter) \\
Literal backslash \t
Tab \n
Line feed \r
Carriage return \x20
Character by 2-digit hex code \u0020
Character by 4-digit hex code