Regex Tester
Test JavaScript regular expressions against sample text.
Build a regular expression using JavaScript syntax, choose the flags you need, and inspect matches against sample text. The tester runs locally in your browser and reports invalid patterns without sending your text anywhere.
Enter the pattern without surrounding slashes. Empty patterns are not run because they can match at every position.
How it works
Use this tool to check whether a JavaScript-style regular expression matches realistic sample text before you paste it into application code, search tooling, or validation rules. Results include the matched text, start and end offsets, numbered capture groups, and named groups when present.
The global flag lists every match; without it, the output stops after the first match. Very broad patterns are capped in the display so the page stays responsive while you refine the expression.
Complex regular expressions can take a long time on large or adversarial input. Test untrusted patterns and large samples carefully, and prefer simpler expressions when possible.