Regex Tester

Test JavaScript regular expressions against sample text with live match highlighting.

//

Highlighted matches

How this regex tester works

Your pattern is compiled with new RegExp(pattern, flags) using standard JavaScript regex syntax, then matched against the test string with matchAll. Matches are highlighted inline so you can see exactly what your expression captures. Everything runs client-side.

Share on LinkedInShare on X
Link to this tool

Copy this HTML to cite this tool from your own site or article.

About Regex Tester

Regex Tester evaluates JavaScript regular expressions against sample text, highlighting all regex matches and capture groups.

How to use Regex Tester

  1. Enter your regular expression pattern and select active flags (g, i, m, s).
  2. Paste sample target text into the evaluation area.
  3. Inspect live match highlights and capture group indices.
  4. Review detailed match breakdown lists.

Examples

Pattern: \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b (i) Target: Info at contact@example.com Match: contact@example.com

FAQ

Which regex engine powers this tester?

It uses the standard JavaScript (ECMAScript) regular expression engine native to your browser.

How are regex syntax errors displayed?

Invalid syntax in regex patterns produces an immediate inline error message describing the regex issue.