Regex Tester & Explainer
Test a pattern against sample text with live match highlighting, inspect captured groups, and get a plain-English, step-by-step breakdown of what the pattern does.
This uses .NET regex syntax (
System.Text.RegularExpressions), which differs
from JavaScript, PCRE, and Python's re in a few ways worth knowing if you're pasting a
pattern from elsewhere:
- Named groups are
(?<name>...)or(?'name'...)— not Python's(?P<name>...). - Named backreferences are
\k<name>— not Python's(?P=name). - .NET supports variable-length lookbehind; PCRE and Python's
retraditionally require fixed-width lookbehind. - .NET has balancing groups,
(?<name1-name2>...), for matching nested/balanced constructs — no other major flavor has this. - Gotcha: unnamed capturing groups are numbered 1, 2, 3... first, in left-to-right order — then named groups get the numbers after that, in their own left-to-right order, regardless of how they're interleaved in the pattern.
/
/
Contact us at support@example.com or sales@example.org for help.
2 matches
Match 1: "support@example.com" (index 14, length 19)
Match 2: "sales@example.org" (index 37, length 17)
Step-by-step explanation
\bA word boundary (between a word character and a non-word character)\w+A word character (letter, digit, or underscore), one or more times@The character '@'\w+A word character (letter, digit, or underscore), one or more times\.The literal character '.' (escaped)\w+A word character (letter, digit, or underscore), one or more times\bA word boundary (between a word character and a non-word character)