Developer Tools

Regex Tester

Test regular expressions live: see every match, capture groups and a highlighted preview.

Enter a pattern and test string, then press Test regex.

Highlighted matches

What is a regex tester?

Regular expressions are powerful but unforgiving — one misplaced character changes what matches. A regex tester lets you try a pattern against your own text and immediately see every match, where each match starts, what each capture group grabbed, and a highlighted view of the test string. It also catches invalid patterns with the browser's own error messages, so you learn what went wrong instead of guessing. Whether you are validating emails, parsing logs, or extracting data, testing first saves hours of debugging.

How to use this tool

  1. Type your pattern in the pattern field (without surrounding slashes).
  2. Tick the flags you need: g for all matches, i to ignore case, m for multiline ^ $, s for dot-all, u for Unicode.
  3. Paste the text to test into the test-string box.
  4. Press Test regex to see the match count, per-match details with capture groups, and the highlighted preview.

Key features

Common use cases

Practical tips

Frequently Asked Questions

Why does my pattern match nothing?
Usual suspects: case mismatch (try the i flag), the pattern being stricter than the text (e.g. \d+ when there are spaces), or anchors ^ $ without the m flag on multiline text. The highlighted preview makes misses obvious.
What do the flags g, i, m, s, u do?
g finds all matches instead of stopping at the first; i ignores case; m makes ^ and $ work per line; s lets . match newlines; u enables full Unicode handling for astral characters and \p{...} classes.
How do I read the capture group results?
Each match lists Group 1, Group 2, and so on in the order their opening parentheses appear in the pattern. A group that did not participate in a particular match is marked as such.
Why is my valid-looking pattern reported as invalid?
The tool uses the browser's native RegExp engine, so the error message is exact — often an unescaped special character, an unfinished group, or a bad flag combination. Fix what the message names.
Is my test data sent anywhere?
No. Pattern compilation and matching run entirely in your browser, so private logs or data samples never leave your device.