Test regular expressions with live match highlighting & capture groups. g/i/m/s flags, quick-reference guide. Free, no sign-up →
100% PrivateNo UploadFree Forever
Quick answer
How to use the free Regex Tester
To test a regex for free, type your pattern and test text — matches highlight live, and capture groups are listed separately. Toggle flags (g, i, m, s) as needed.
//g
69 chars
Highlighted matchesNo matches
Edit this text to see matches.
The regex engine runs in your browser.
Match details
No matches in the test string.
Test and debug regular expressions in your browser
Regular expressions are one of the most powerful tools in a developer's toolkit, but they're also notoriously easy to get wrong. This tester gives you a live, interactive sandbox: type a pattern, toggle the flags you need, paste in some text, and watch every match light up. Capture groups and named groups show up in the match details panel so you can verify your extraction logic before shipping it to production.
How to use the tester
Enter your pattern in the input — no delimiters needed, just the expression itself. Toggle g to find all matches, i for case-insensitive matching, and m when you need anchors to apply per line. The test string area accepts any text you want to scan. Matches are highlighted in real time as you type, and the match count appears just above the preview. Use the quick-reference table on the side to drop common tokens like \d, \w, or \b into your pattern with a click.
Common patterns to try
Start with \b\w+\b to match every word, or \d+ to find numbers. Use [\w.+-]+@[\w-]+\.[\w.-]+ to spot email-like strings. Named groups such as (?<year>\d{4})-(?<month>\d{2}) make complex extractions readable. Whenever a pattern fails, the syntax error message points directly at the issue.
Private by design
Everything happens locally. The browser's RegExp engine compiles and runs your pattern, and the page never sends your text or expression to any server. That makes this tool safe for log fragments, sample customer data, or any sensitive content you want to experiment with.
Questions
Frequently asked questions
What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. Regex is used to find, match, and replace text — common tasks include validating email addresses, extracting URLs, parsing log files, and search-and-replace in code editors. This tool uses your browser's native RegExp engine, the same one JavaScript uses at runtime.
What do the flag toggles do?
Each flag changes how the regex engine matches. g (global) finds every match instead of stopping at the first. i (case-insensitive) treats A and a as equal. m (multiline) makes ^ and $ match the start and end of each line. s (dotAll) lets the dot match newline characters. u (unicode) enables full Unicode support including surrogate pairs and \p{} property escapes. y (sticky) requires the match to start exactly at the regex's lastIndex.
Why does my pattern show a syntax error?
The tool reports the exact error message thrown by the browser's regex engine. Common causes are unbalanced parentheses, an unfinished character class like [abc, an invalid escape such as \j, or a backreference to a group that doesn't exist. Check the highlighted message — it usually points to the problem character.
How do capture groups and named groups work?
Parentheses (abc) create a capture group whose matched text appears in the match details under $1, $2, and so on. Named groups use the (?<name>abc) syntax and appear in the named groups section. Use (?:abc) when you want to group without capturing, which keeps the numbering simple and improves performance.
Is my pattern or test string sent to a server?
No. Everything runs locally in your browser using the built-in RegExp object and String.prototype.matchAll. No data leaves your device, nothing is uploaded, and the tool works offline once the page is loaded.
Free regex tester & debugger
Write, test and debug regular expressions with live match highlighting — entirely in your browser. See capture groups, test against sample text, and get instant feedback. Includes a quick-reference guide for common patterns. No upload, no sign-up.
A regex is a pattern that matches, finds or replaces text. It's a powerful tool for validation (email addresses, phone numbers), search-and-replace, log parsing, and data extraction. Most programming languages, text editors and command-line tools support regex.
Common regex patterns
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$ — validates an email address.
d{3}[-.]?d{3}[-.]?d{4} — matches a US phone number.
https?://[^s/$.?#].[^s]* — extracts URLs from text.
Frequently asked questions
Does the regex tester show capture groups? Yes — the ToolCrix regex tester lists each capture group separately with its matched text as you type.
Which regex flags are supported? The ToolCrix tester supports g (global), i (case-insensitive), m (multiline) and s (dotAll) — toggle them and matches re-highlight instantly.
Which regex flavour does it use? The ToolCrix regex tester runs your browser's native JavaScript (ECMAScript) engine — the same behaviour you'll get in Node.js and front-end code.
Is it safe to test against real log data? Yes — the ToolCrix regex tester evaluates patterns and test text entirely in your browser, so production logs and user data are never uploaded.