Skip to content

Regex Tester

Developer utilities · Done in 3 steps

Stays on your deviceFree · No sign-up
  1. 1Type a pattern
  2. 2
  3. 3
Loading tool…

About

Test JavaScript regular expressions with live match highlighting, a groups table, replace preview, cheat sheet and ready-made patterns.

How to use it

  1. 1Type a pattern and toggle flags (g, i, m, s, u, y).
  2. 2Paste a test string — matches highlight as you type.
  3. 3Open Match details for indexes and capture groups, or Replace to preview substitutions.
  4. 4Pick a common pattern (email, URL, date…) to start from.
You give
A JavaScript regex pattern, flags and test text
You get
Highlighted matches, capture groups, replacement output
Good to know
JavaScript (ECMAScript) syntax only — PCRE features like possessive quantifiers, recursion or inline (?i) flags aren't supported. Matching stops after 1.5 s and shows at most 5,000 matches.
Privacy
Processed on your device. Nothing is uploaded, stored or logged.
Last tested
2026-10-28

FAQ

Can a bad pattern freeze the page?

No. Matching runs in a Web Worker that is terminated after 1.5 seconds, so catastrophic backtracking just shows an error.

How do I reference groups in the replacement?

Use $1, $2… for numbered groups, $<name> for named groups, $& for the whole match and $$ for a literal dollar sign.

Will my regex work in Python or PHP?

Most simple patterns are portable, but lookbehind, named group syntax and Unicode classes differ between engines. Test in the target language before shipping.

Go further with AI