Developer Utilities · runs locally

Regex Tester

Test JavaScript regular expressions with live matching and capture groups.

Loading the regex tester…

The tool runs locally in your browser.

Patterns you can trust before you ship

A regex that looks obvious in a code review often fails on the first real input. This tester runs your pattern against sample text in the browser and shows every match, every capture group and every flag effect as you type.

What you can do

  • Test with g, i, m, s and u flags
  • See match positions highlighted in the sample text
  • Inspect capture groups for each match
  • Get a plain-language reading of the pattern

How to use it

  1. Enter the pattern, without slashes.
  2. Choose the flags your engine needs.
  3. Paste representative sample text — include the awkward cases.
  4. Check the highlighted matches and adjust.

Runs locally

Everything executes with the browser's native RegExp engine. Sample text — which may contain emails, tokens or customer records — stays on the device.

Frequently asked questions

Does it support lookahead and backreferences?
Yes, this is JavaScript's engine, so lookaround works where the browser supports it.

Why does my pattern match an empty string?
An optional quantifier with nothing required in between will match zero characters. Anchor the pattern.

Can I save patterns?
Copy the pattern with its flags into your code or notes — nothing is stored here.