BYTETOOLS

Regex Tester

Test regular expressions online with live match highlighting, capture groups and flag toggles (g, i, m, s, u, y). Free, instant and 100% private in your browser.

/
/g
2
Matches
0
Groups / match
All
Mode

Highlighted matches

Contact us at hello@example.com or sales@bytetools.io for help.

Match details

Match 1at index 14

hello@example.com

Match 2at index 35

sales@bytetools.io

What is the Regex Tester?

The ByteTools Regex Tester lets you write a regular expression, toggle the flags you need, and instantly see every match highlighted inside your test string.

  • Live highlighting of every match in the test string
  • Toggle all six JavaScript flags: g, i, m, s, u, y
  • Lists numbered and named capture groups per match
  • Shows total match count and match positions
  • Clear error message for invalid patterns
  • 100% client-side — patterns and data never leave your browser

How to use the Regex Tester

  1. 1

    Type or paste your regular expression into the pattern box.

  2. 2

    Toggle the flags you need: g (global), i (ignore case), m (multiline), s (dotall), u (unicode) or y (sticky).

  3. 3

    Enter or paste the test string you want to match against.

  4. 4

    Review the highlighted matches, match count and per-match capture groups.

  5. 5

    Fix any error shown for an invalid pattern and repeat.

About the Regex Tester

The ByteTools Regex Tester lets you write a regular expression, toggle the flags you need, and instantly see every match highlighted inside your test string. It uses your browser's own JavaScript regex engine, so the behaviour matches exactly what your code will do at runtime.

Each match is broken down for you: the matched text, its position in the string, and every numbered and named capture group — with a running match count at the top. If your pattern is invalid, the exact engine error is shown instead of a silent failure, so you can fix it quickly.

Everything runs locally in your browser. Your patterns and test data are never uploaded, which makes it safe for logs, sample records and any sensitive text you need to experiment with.

Frequently asked questions

How do I test a regular expression online?

Enter your pattern, choose the flags you want, then type the text to test against. The tool runs the regex with the browser's native engine and highlights every match while listing the capture groups, so you can confirm the pattern behaves as intended.

What do the g, i, m, s, u and y flags do?

g finds all matches instead of just the first, i makes matching case-insensitive, m lets ^ and $ match line boundaries, s lets the dot match newlines, u enables full Unicode handling, and y (sticky) anchors each match to the current position. Toggle them to see how the results change.

Why is my regex showing only one match?

Without the global (g) flag, a regular expression stops after the first match. Enable the g flag to find and highlight every occurrence in your test string.

What are capture groups?

Capture groups are the parts of your pattern wrapped in parentheses. Each match lists the text captured by every numbered group, and named groups written as (?<name>…) are shown by their name so you can extract exactly the pieces you need.

Is this the same regex engine my code uses?

If you write JavaScript, yes — the tester uses the browser's built-in RegExp engine. Other languages differ slightly in syntax and features, but the core constructs (character classes, quantifiers, groups, anchors) behave the same way almost everywhere.

Is my test data uploaded anywhere?

No. The pattern and test string are processed entirely in your browser tab and never sent to a server, so it is safe to paste real log lines or private text.

Guides for Regex Tester

Related tools