Regex Tester — Live Match Highlighting
Test JavaScript regex patterns with live match highlighting, capture groups, flag toggles and instant syntax errors. Caps at 1000 matches.
You're on 7BusyBoss — 300+ free tools that run instantly in your browser. No signup, nothing uploaded.
Email addresses in text need both match and capture
When you have a line like Contact: hello@7busyboss.com or support@example.org, you might only want the domain part, not the full address. Testing \b(\w+)@(\w+)\.(\w+)\b gives you both the whole match and three capture groups — local part, domain name and TLD. This tester shows all of it: each group appears in the match details table so you can see exactly what you would extract in code.
Flags force re-evaluation of your entire pattern
The same pattern behaves differently with each flag. Case-insensitive i makes \bEmail\b match Email, EMAIL or email. The global flag g forces the loop to find every occurrence, not just the first. Multiline m makes ^ and $ match line starts and ends rather than string boundaries. Dotall s lets . match newlines, and u enables Unicode handling. Toggle each and watch the highlights shift. The sticky flag y is not offered.
A pattern that gets stuck is a pattern that hangs your tab
Some patterns cause catastrophic backtracking: the engine tries so many combinations of the same substring that it effectively never returns. (a+)+b tested against a long run of a characters that never reaches a b is the classic case. This tester caps results at 1000 matches, which prevents runaway match loops, but nothing can interrupt the engine inside a single match attempt. If you paste a pathological pattern and the tab locks up, that is what happened — close the tab and simplify the pattern.
Capture groups carry their order, not their names
JavaScript supports named groups via (?<name>pattern), and they work here — but the match table lists groups by position, not by name. Write (?<domain>\w+\.\w+) and the output still labels it group 1. The position is what you index in code, so this is a display limitation rather than a functional one. For validating structured data instead of matching text, see the JSON Formatter.
How to use the Regex Tester
Takes about a minute. No signup, no download, your data stays in your browser.
- 1Open the tool. Scroll up to the Regex Tester above — it loads instantly in your browser, no install needed.
- 2Enter your values. The fields come pre-filled with realistic defaults so you can see how it works — replace them with your own numbers.
- 3Read the result. The output updates instantly. Copy or share it — nothing is uploaded to a server, everything stays on your device.
Frequently asked questions
Common questions about the Regex Tester.
Why did my tab freeze when I tested a pattern?
Certain patterns cause catastrophic backtracking, where the engine tries exponentially many combinations without returning. This tester caps results at 1000 matches to prevent runaway loops, but it cannot interrupt the engine during a single match attempt, so a pathological pattern can still lock the tab.
Are named capture groups supported?
Yes. JavaScript supports named groups via the (?<name>pattern) syntax and they capture normally here. However, the match details table lists every group by position rather than by name, so a named group still shows as group 1 in the output.
Why does adding or removing a flag change every highlight?
Each flag changes how the engine interprets the whole pattern. Global enables repeated searching, case-insensitive ignores letter case, multiline makes the anchors match line boundaries, dotall lets the dot match newlines, and unicode enables proper Unicode handling. Any change re-evaluates the pattern against your whole test string.
What if I paste an invalid regex?
The pattern is validated as you type and invalid syntax shows a red error message below the input. JavaScript reports specific problems such as nothing to repeat or unterminated character class, which usually points straight at the character you need to fix.
Community rating
Discussion (0)
No comments yet. Start the discussion.
Keep exploring
Related tools across 7BusyBoss — all free, all instant.
More in Code Formatters
- Markdown Editor
- JSON Formatter & Validator
- JSON to YAML Converter
- Markdown to HTML Converter
- JSON ↔ CSV Converter