← All Tools

Regex Tester & Explainer — Test Regular Expressions Online

Test regular expressions with live match highlighting, capture groups, and named groups. Get a plain-English explanation of common patterns. Supports JavaScript regex syntax with flags (g, i, m, s).

Free, no sign-up — one of the SaaSQuickStart Developer tools.

How it works

This tool uses JavaScript's built-in RegExp engine, which runs entirely in your browser. The pattern you enter is compiled into a RegExp object with your chosen flags. With the global (g) flag, exec() is called in a loop to find every match and its position. Capture groups — the parts inside parentheses () — are extracted automatically from each match result. No data ever leaves your browser.

Frequently asked questions

Why do I need to double-escape backslashes here?

When you type a pattern in a text input (not inside JavaScript source code), there is no string literal layer — backslashes go directly into the RegExp engine. So you type \d exactly as shown, not \\d. The tool takes what you type and passes it straight to new RegExp(pattern).

What is the difference between the g flag and no g flag?

Without the global flag, the regex stops after the first match. With the g flag, it continues searching from where the last match ended, returning all non-overlapping matches. Use g when you want to find every occurrence in a long string.

What are capture groups and how do I use them?

Wrap part of your pattern in parentheses to create a capture group: e.g. (\d{4})-(\d{2})-(\d{2}) captures year, month, and day separately from a date string. Each group is shown in the results as Group 1, Group 2, etc. Capture groups let you extract specific sub-parts of a match.

Can I use named capture groups?

Yes — JavaScript supports named groups using (?<name>...) syntax, e.g. (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}). Named groups appear in the match result under m.groups.year etc. This tester displays them as numbered groups since the underlying exec() result still orders them numerically.

All free tools · SaaSQuickStart