Regex Tester

Write a regular expression and see every match highlighted in your text as you type — with capture groups, flags and a match count. Private and free.

/ /
Flags:

How to use the regex tester

  • Type your pattern between the slashes and set flags (g, i, m, s).
  • Enter a test string — every match is highlighted live, with a count and capture groups.
  • Invalid patterns show an error message so you can fix them as you go.

Quick regex reference

Common building blocks: \d a digit, \w a word character, \s whitespace, . any character, * zero or more, + one or more, ? optional, [abc] a set, (…) a capture group, ^ start, $ end, \b a word boundary. This tool uses the JavaScript regular-expression engine, the same one that runs in every browser.

Benefits

  • Live match highlighting as you type your pattern.
  • Shows a match count and numbered capture groups.
  • Toggle g / i / m / s flags and see invalid-pattern errors instantly.
  • Runs on the native browser regex engine — nothing uploaded.

Limitations to know

  • It uses JavaScript (ECMAScript) regex, which differs from PCRE/Python in some advanced features.
  • Catastrophic-backtracking patterns on very long text can be slow.
  • It highlights matches but does not do search-and-replace.

Common mistakes to avoid

  • Forgetting the g flag and wondering why only the first match shows.
  • Not escaping special characters like . or ( when you mean them literally.
  • Assuming Python/PHP regex features that JavaScript doesn’t support.

Alternatives

To replace matched text use Find & Replace; to compare two versions of text use the Diff Checker.

Last updated: August 2026 · Reviewed by the AI Toolbox editorial team.

Frequently asked questions

Is my text or pattern uploaded?

No — matching runs entirely in your browser using the native JavaScript regex engine.

Which regex flavor is this?

JavaScript (ECMAScript) regex. It's close to PCRE for everyday patterns but has some differences in advanced features.

Why does my global match loop or hang?

A pattern that can match an empty string with the g flag is handled safely here, but avoid catastrophic backtracking patterns on very long text.

Can I see capture groups?

Yes — each match lists its numbered capture groups below the highlighted text.

Related tools