X Xerobit

Regex Tester

Test regular expressions with live match highlighting. Inspect capture groups, preview replacements, and use preset patterns for common needs. Uses your browser's native JavaScript regex engine — same one you'd use in code.

 
Replace preview (optional)
 
Matches with groups
Ready. Edit pattern or test string.

Live Market Insight

DataForSEO · 2026-04-25
Vol (US)
22,200
"regex tester"
CPC
$11.24
Cluster
4 kws
Top competitor
regex101.com
5/10 SERPs

How to use the regex tester

  1. Enter your pattern between the slashes at the top. Flags (g, i, m, s, u, y) go in the second input.
  2. Type or paste a test string on the left. Matches highlight live.
  3. Inspect capture groups in the "Matches with groups" list — $0 is the whole match, $1+ are the groups.
  4. Use the Replace input to preview a substitution. Supports $1, $2, and $&.
  5. Dropdown presets give you a starting pattern for email, URL, IPv4, UUID, ISO date, phone, hex color.

JavaScript regex flags — what they do

Catastrophic backtracking — the regex that kills your server

Patterns like (a+)+b can blow up exponentially on input like aaaaaaaaaaaaaaaaaaaaaaaaaaX. The engine tries every split of the as before giving up. One user-submitted regex on your server is a denial-of-service away.

Defenses:

Named capture groups

Use (?<name>...) to name a group. Access in replacement with $<name> and in code via match.groups.name. Much more maintainable than numeric groups once you have more than two.

FAQ

Does this match PCRE or JavaScript flavor?

JavaScript. This tool uses your browser's native RegExp engine, so results match what your Node.js, Deno, or browser code will do. Some PCRE features (lookbehind has broader support, atomic groups) don't exist in JavaScript regex.

Can I test with large inputs?

Yes, but the highlighted matches are capped at 200 visible entries to keep the UI responsive. Matching itself handles up to 10,000 match iterations before safety-cutting.

Is anything sent to a server?

No. Everything runs in your browser.

Related tools

Pillar

Part of Dev Productivity — regex, cron, timestamps, HTTP, color, word counter, aspect ratio, case.


Written by Mian Ali Khalid. Last updated 2026-04-25.