Regex Tester
Use this tool to test JavaScript regular expressions against a sample string. It highlights matches in the test text and lists match details, including capture groups and named groups when the pattern produces them.
The pattern input expects the pattern body without surrounding slashes. The UI shows the selected flags next to the pattern.
Common Use Cases
Checking a Pattern Before Adding It to Code
Try a pattern with realistic sample text and confirm where each match starts.
Inspecting Capture Groups
Use match details to see numbered or named groups returned by JavaScript RegExp.
Starting from a Preset
Use presets such as email, URL, IPv4, ISO date, hex color, or Japanese phone number as editable starting points.
How to Use
- Enter a JavaScript regex pattern in the pattern field.
- Turn on the flags you need:
g,i,m, ors. - Paste or edit the test string.
- Review the highlighted matches and the match details below the input.
- Use a preset if you want a starting pattern to edit.
Notes / Limitations
Regex syntax differs by engine. This tool uses JavaScript
RegExp, not PCRE, Python, Ruby, or database-specific regex syntax.
- The UI exposes
g,i,m, andsflags. - With the
gflag enabled, the matcher lists up to 100 matches to avoid runaway output. - Presets are examples for quick testing, not full validation rules for every real-world value.
- Invalid regex syntax is shown as an error from the JavaScript regex engine.
Privacy & Processing
Pattern testing runs in the browser with JavaScript. The regex tester code does not send your pattern or test string to a server.