Regex Tester

Test a regular expression against sample text and inspect every match and capture group.


        

What is a regex tester?

A regular expression is a compact pattern for finding and extracting text. This tester compiles your pattern with the browser's native RegExp engine β€” the same one Node.js and every JavaScript runtime use β€” so what you see here is exactly what your code will do.

Flags and capture groups

Add flags such as g (global), i (case-insensitive), m (multiline) or s (dotall) to change how matching works. Each result lists the full match, its index in the string, and every numbered or (?<named>) capture group, so you can see precisely what your pattern extracts.

How to use the Regex Tester

  1. Enter a pattern. Type the regular expression body, without slashes.
  2. Add any flags. Combine letters from gimsuy to control matching.
  3. Provide test text. Paste the string you want to match against.
  4. Read the matches. See each match, its index and capture groups live.

Frequently asked questions

Which regex flavour is this?

JavaScript (ECMAScript) regular expressions, since it uses the browser RegExp engine. Most syntax is shared with PCRE, but a few features differ.

Why do I only get one match?

Without the global g flag, matching stops at the first result. Add g to list every match in the text.

Do capture groups show up?

Yes. Numbered groups and named groups are listed under each match, with "(no match)" for optional groups that did not participate.

What happens with an invalid pattern?

The engine's SyntaxError is shown so you can correct the pattern; nothing is sent anywhere.