Developer Tools

Regex Tester

Test a regular expression against sample text and see every match highlighted instantly, with capture groups broken out.

Highlighted matches will appear here.
Match details will appear here.
Advertisement space

How Regex Tester Works

The tester compiles your pattern and flags into a JavaScript regular expression and runs it against the test string using matchAll(), which finds every non-overlapping match. Each match is highlighted in place, and any capture groups inside it are listed separately.

How to Use This Tool

  1. Type a regular expression pattern (without the surrounding slashes).
  2. Add flags if needed — g for all matches, i for case-insensitive, m for multiline.
  3. Paste your test string.
  4. Select Test Regex to see every match highlighted, with capture groups listed below.

Example

Pattern [a-z]+@[a-z]+\.[a-z]{2,} with flags gi against Contact us at hello@toolworld.app or support@example.com. finds two matches: hello@toolworld.app and support@example.com.

Helpful Tips

  • If you forget the g flag, the tool still finds every match — it's applied automatically when searching, though it's shown in the flags field if you typed it.
  • Invalid patterns (like an unmatched bracket) show a specific JavaScript regex error instead of silently failing.

Frequently Asked Questions

Do I need to include the slashes around my pattern?
No — type just the pattern itself, like \d+, not /\d+/.
What flags are supported?
All standard JavaScript regex flags: g (global), i (case-insensitive), m (multiline), s (dot matches newline), u (unicode) and y (sticky).
Is my text or pattern sent anywhere?
No, matching runs entirely in your browser using JavaScript's built-in regular expression engine.

This tool runs entirely in your browser. Your input is not uploaded to any server.