Regex Tester

JavaScript regular expression syntax, without the surrounding slashes.

Flags

Drop a text file here to load it.

Matches highlighted

	

Enter a pattern to begin.

About this tool

Regex is powerful, but it’s also easy to get one character wrong and spend twenty minutes staring at the screen. This tool gives you a safer place to test the pattern first. Matches are highlighted in your text and listed with their position and capture groups.

How to use it

  1. Enter a pattern without the surrounding slashes, or choose an example to start from.
  2. Pick flags. Turn on g to find every match instead of just the first.
  3. Paste your sample text. Matches highlight as you type, and the table below shows each match’s position and capture groups.
  4. Copy or download the matches as plain text or as JSON.

Common uses

  • Find email-like text
  • Validate simple input
  • Extract IDs
  • Check logs
  • Search through messy blocks of text

Tip: Start with a small pattern and build it in steps. A pattern you understand is better than a clever one you can’t fix later. Test it against text that should not match, too.

Privacy note

Your pattern and text are tested in your browser, in a background thread. Nothing is sent to a server, so logs and customer data stay on your device. Still, scrub secrets before you paste.

Frequently asked questions

Which regex flavor does this use?

JavaScript (ECMAScript), the engine built into your browser. It supports named groups, lookahead, lookbehind, and Unicode property escapes. It does not support PCRE-only features such as atomic groups, possessive quantifiers, or inline flags like (?i), so use the flag boxes instead.

What do the flags mean?

g finds all matches. i ignores letter case. m lets ^ and $ match at line breaks. s lets . match newlines. u turns on full Unicode handling.

Why does it say the pattern took too long?

Some patterns, such as (a+)+$, cause catastrophic backtracking and can run for minutes on short input. The test runs in a background worker and is stopped after two seconds so your page stays responsive. Make the pattern more specific, or avoid nested quantifiers.

Why do I only see one match?

Without the g flag a regular expression stops after the first match. Turn g on to list them all.