Skip to content

Regex Tester

Test regular expressions live with match highlighting, capture and named groups, flags and a replace preview.

  • Free, no sign-up
  • Runs in your browser
  • Reviewed Nov 6, 2026

How to use the Regex Tester

  1. Type a pattern and choose flags.
  2. Paste test text — matches highlight as you type.
  3. Inspect groups in the table and try a replacement string.

How it works

Uses the browser's JavaScript RegExp engine with matchAll() to list every match, its index and its numbered or named groups, and String.replace() for the replacement preview ($1, $<name>). Runs entirely in your browser — nothing you paste is sent to our servers.

Worked examples

Find emails

(?<user>[\w.+-]+)@(?<domain>[\w-]+\.[\w.]+) with flag g matches two addresses in the sample and exposes user and domain groups.

Limitations and assumptions

  • JavaScript regex differs from PCRE/Python in some features (e.g. possessive quantifiers).
  • A badly written pattern can be slow on long text (catastrophic backtracking).

Frequently asked questions

Why does my pattern match nothing?

Check escaping: in this box type \d, not \\d. Also check flags — without i, matching is case-sensitive.

G

Built and reviewed by Guru G

Calculation logic is covered by automated tests against known values. Last reviewed Nov 6, 2026. Found a problem? Let us know — see our editorial policy.