Regex Tester

Test regular expressions against any text in real time. See highlighted matches, capture groups, match count and flag options — all running in your browser.

//g

Write your regular expression, set the flags, and paste your test text. Matches highlight in real time as you type, with a detailed breakdown of every match and its capture groups. No installation, no server round-trips — everything runs in your browser.

When to Use the Regex Tester

Use the regex tester when writing validation patterns, building search-and-replace rules, parsing log files, extracting data from text, or learning regular expressions with instant visual feedback.

Tips

  • Start simple and build up. Test each part of your pattern before combining them.
  • Use non-capturing groups (?:...) when you need grouping but do not need the captured value — it is slightly faster.
  • The multiline (m) flag is essential when you want ^ and $ to match at line boundaries, not just the start and end of the entire string.
  • If your pattern runs slowly, look for nested quantifiers like (a+)+ which cause catastrophic backtracking.

Frequently Asked Questions

Which regex flavour does this use? ▾

It uses JavaScript regular expressions (ECMAScript). This is the same flavour used in Node.js, browsers, TypeScript, and most modern web frameworks.

What do the flags g, i, m and s mean? ▾

g (global) finds all matches, not just the first. i (case-insensitive) ignores case. m (multiline) makes ^ and $ match line starts/ends. s (dotAll) makes the dot match newline characters.

Why is my pattern showing no matches? ▾

Check that you have the global (g) flag enabled if you expect multiple matches. Also verify your pattern does not have an unescaped special character — use a backslash to escape characters like . * + ? ( ) [ ] { }.

Can I see capture groups? ▾

Yes. The results panel shows each match along with its numbered capture groups. Named groups (using (?...)) are also displayed.

Is my text stored anywhere? ▾

No. The regex matching runs entirely in your browser. Your test text and patterns are never sent to any server.

Can it handle large text inputs? ▾

Yes. The tester handles thousands of lines efficiently since it uses the browser's native RegExp engine. Extremely complex patterns with heavy backtracking may be slow on any platform.

Related Tools