Regex Tester
Test regular expressions against sample text. Highlight matches, inspect groups, and toggle flags.
How to use Regex Tester
- 1Enter a pattern
Type your regex pattern and toggle flags (g, i, m, s, u).
- 2Add test text
Paste the text you want to match against.
- 3Inspect matches
All matches highlight in the text. Capture groups list below.
About Regex Tester
Regular expressions are powerful but unforgiving — a single misplaced escape, a greedy quantifier where lazy was needed, or a forgotten flag can make a pattern silently match the wrong things. Worse, they fail silently: the regex compiles, runs, and returns no matches when it should have found dozens. A live regex tester gives you instant visual feedback: paste your pattern, paste sample input, and see exactly which substrings match.
Utilify uses the JavaScript (ECMAScript) regex engine — the same one your code runs against in the browser or Node.js. Capture groups, named groups, lookahead, lookbehind, and Unicode property escapes all behave as they would when you call .match() or .exec() in your own code. Toggle the standard flags (g, i, m, s, u) to test variants without re-typing.
The flags change everything, and they are the most common source of confusion. The "g" (global) flag finds every match instead of just the first; "i" makes matching case-insensitive; "m" (multiline) makes "^" and "$" match at line boundaries rather than only at the start and end of the whole string; "s" (dotAll) lets "." match newline characters; and "u" enables full Unicode mode. Flipping these on and off here is the fastest way to understand why a pattern that "should work" is not behaving.
Capture groups are the other half of practical regex work. Parentheses create numbered groups you can pull out of each match, and "(?<name>...)" creates named groups that are far more readable in replacement strings and code. The tester lists every group it captures per match, so you can confirm you are extracting exactly the right slice — the date out of a log line, the domain out of a URL, the version out of a tag — before you wire the pattern into your application.
One practical caution: poorly written patterns with nested quantifiers can trigger catastrophic backtracking, where the engine explores an exponential number of paths and appears to hang. If the page freezes on a particular pattern and input, that is the cause — simplify the pattern or anchor it more tightly, and the problem usually disappears.
When to use Regex Tester
- Validating input formats
Test email, phone, or postal-code patterns against real-world samples.
- Log parsing
Develop the regex you will use to extract structured fields from server logs.
- Find-and-replace prep
Verify a substitution pattern matches only what you intend before running it across a codebase.
Examples
Email Alice at [email protected] or Bob at [email protected]
Pattern: \b\w+@\w+\.\w+\b with the g flag.
Frequently asked questions
Which regex flavor is this?+
JavaScript (ECMAScript) — the same regex engine built into your browser and Node.js, so behavior matches what your code will do.
Does it handle very large inputs?+
Up to a few MB comfortably. Pathological regexes (catastrophic backtracking) may hang the page — refresh to recover, then simplify or anchor the pattern.
What do the g, i, m, s, and u flags do?+
"g" finds all matches, "i" is case-insensitive, "m" makes ^ and $ match at line breaks, "s" lets "." match newlines, and "u" enables full Unicode mode.
Can I use capture groups and named groups?+
Yes. Numbered groups "( )" and named groups "(?<name>...)" both work, and the tester lists every captured group for each match so you can confirm what you are extracting.
Is my pattern or test text uploaded?+
No. Everything runs locally in your browser — your patterns and sample data never leave your device.
Related tools
Format, beautify, and validate JSON online. Free, fast, runs entirely in your browser.
Validate JSON syntax online with clear error messages and line numbers. Free and private.
Encode and decode Base64 strings online. UTF-8 safe, browser-only — your data never leaves your device.