Home › Developer Tools › Regex Tester

Regex Tester

Build and debug regular expressions with instant highlighting.

  • Free & unlimited
  • No sign-up
  • Instant results

How to use the Regex Tester

  1. Type your pattern and tick the flags.
  2. Paste the text to test against.
  3. See highlighted matches, groups and an optional replace preview.

Flags

  • g – find all matches, not just the first
  • i – ignore upper/lower case
  • m – ^ and $ match at every line
  • s – . also matches line breaks
  • u – full Unicode support

Cheat sheet

\d digit   \w letter/digit/_   \s space
.  any char   * 0+   + 1+   ? 0 or 1   {2,4} 2 to 4
^ start   $ end   [abc] one of   (x) group   a|b either

Safe on slow patterns

Patterns that would freeze the browser (catastrophic backtracking) are stopped after 1.5 seconds with a warning.

Frequently asked questions

Which regex flavour is this?

JavaScript (ECMAScript), which is very close to PCRE used by PHP and most editors.

How do I use groups in the replacement?

Use $1, $2 for numbered groups, or $<name> for named groups.

Is my text uploaded?

No, matching runs in your browser.

Related tools