Regex Tester
Test JavaScript regular expressions against sample text instantly in your browser with match highlighting.
Evaluating…
Ada wrote the first algorithm. Grace built the first compiler. Linus built a kernel and Ada wrote notes.
No matches.
Enter a pattern to preview replacement. An empty replacement removes matches.
How it works
Regular expressions are patterns compiled by the JavaScript RegExp engine. This tester constructs a RegExp from your pattern and flags, then runs it against the sample text to list matches, capture groups, and indices. Highlighting helps you see what the engine consumed. Matching and replacement run in a local background worker with a one-second timeout, so excessive backtracking can be stopped without freezing the page. Results use your browser’s ECMAScript engine, including lookarounds where supported. No text is transmitted. The tester shows up to 1,000 matches and limits input and replacement sizes to keep previews responsive. An empty replacement removes matched text. Prefer explicit flags and small representative samples.
Frequently asked questions
Which regex flavor is this?
JavaScript/ECMAScript via the browser RegExp engine—the same flavor used in most web apps.
Can I use multiline or dotAll flags?
Yes. Toggle standard flags such as g, i, m, s, and u from the interface.
Does my test string get uploaded?
No. Matching runs entirely client-side for privacy-sensitive samples.
Why was my expression stopped?
Matching and replacement are stopped after one second to prevent excessive backtracking. Simplify the expression or shorten the test text and retry.
More private tools
- JSON to TypeScriptGenerate interfaces or types from any JSON sample.
- Cron Expression BuilderBuild, explain and preview cron schedules.
- JWT DecoderInspect token headers, claims and expiry.
- SQL FormatterPretty-print queries for 7 SQL dialects.
- Format ConverterJSON, YAML, CSV, XML and TOML in any direction.