All Guides

Online Regex Tester

Regex Tester runs a regular expression against your sample text as you type, highlighting every match directly in the text and breaking out each match's capture groups.

  1. 1Open the Regex Tester tool.
  2. 2Type a pattern. Toggle flags (g, i, m, s) to change how it matches.
  3. 3Paste your sample text. Matches highlight live, with capture groups listed below.
Open Regex Tester

Frequently asked questions

What does the "g" flag do here?

With it on, every match in the text is found and highlighted. With it off, only the first match is shown, matching how a regex behaves by default in most programming languages.

What happens if my pattern is invalid?

The tool shows the JavaScript engine's own error message (like an unterminated character class) instead of silently failing, so you can see exactly what's wrong with the pattern.

Does it use JavaScript's regex flavor?

Yes, since it runs directly in your browser using JavaScript's built-in RegExp. Syntax specific to other languages' regex flavors (like PCRE's lookbehind extensions in older engines) may behave differently.