Text & Regex
Regex Tester
Test a regular expression against your own sample text and see every match highlighted, with capture groups and clear explanations when a pattern is invalid. Everything runs in your browser — your text never leaves the page.
Regular expression
JavaScript RegExp
Matches are found globally. Use (…) to capture groups, (?<name>…)
for named groups, and the flags above to change how the pattern is interpreted.
Sample text
editableHighlighted matches
0 matchesMatch details
capture groupsHow it works
The pattern is compiled with the browser’s own RegExp engine and run
against your text locally. Invalid patterns are reported with the engine’s reason and
a short hint instead of failing silently. A few handy tokens:
. any character, \d digit, \w word character,
* + ? quantifiers, [abc] character class,
^ $ line anchors, (…) capture group.
Practical uses
Test a regular expression against your own sample text with highlighted matches and capture groups.
Common ways to use it
- Debug a pattern against real log lines or sample data.
- Inspect capture groups before using a pattern in code.
Things to keep in mind
- Uses JavaScript regular-expression syntax; patterns from other languages may need translation.