Regex Tester

Write a JavaScript regular expression and see every match, capture group and replacement highlighted as you type.

Nothing leaves your browser

How it works

  1. 1Write a patternType the pattern without slashes and switch flags like g, i and m on or off.
  2. 2Add test textMatches are highlighted and listed with their capture groups.
  3. 3Try a replacementPreview a replace with $1 or $<name> references before you use it in code.

Questions

Is my text sent anywhere?

No. Everything runs in your browser and nothing you type or open is uploaded, logged or saved. Your settings are remembered on this device; your text isn't.

Which regex flavour is this?

Your browser's JavaScript engine, the same one your front-end code uses. Patterns written for PCRE, Python or .NET mostly work, but lookbehind support, named group syntax and flags can differ.

What happens if my pattern hangs?

Patterns run in a separate worker and are stopped after 2 seconds, so the page never freezes. A hang usually means catastrophic backtracking from nested quantifiers like (a+)+. Safari gives up on these patterns by itself after about half a second and reports no match.