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.
Highlighted matches
Contact us at hello@example.com or sales@bytetools.io for help.
Match details
hello@example.com
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
Type or paste your regular expression into the pattern box.
- 2
Toggle the flags you need: g (global), i (ignore case), m (multiline), s (dotall), u (unicode) or y (sticky).
- 3
Enter or paste the test string you want to match against.
- 4
Review the highlighted matches, match count and per-match capture groups.
- 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
String Escape / Unescape
Escape or unescape strings for JavaScript and JSON literals: quotes, backslashes, newlines, tabs and \uXXXX. Two-way, free and fully private in your browser.
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
URL Parser
Parse a URL into protocol, host, port, path, query parameters and hash. Handles relative URLs with a base and shows query params in a table. Free and private.
HTML Formatter
Format HTML online with clean, consistent indentation. This HTML formatter handles void elements and preserves pre, script and style exactly. Free and private.