Send feedback to hello@briskly.tools or support@example.com. Old addresses like admin@old.co.uk should match too. Not a match: plain text. Also not: @notanemail. Multiple per line: foo@bar.com, baz@qux.io
"hello@briskly.tools"idx 17–36"hello""briskly.tools""support@example.com"idx 40–59"support""example.com""admin@old.co"idx 80–92"admin""old.co""foo@bar.com"idx 181–192"foo""bar.com""baz@qux.io"idx 194–204"baz""qux.io"· ECMAScript flavor (native JavaScript RegExp) · runs in your browser · nothing uploads
What regex is
A regular expression is a pattern that describes a set of strings. Given the pattern and a piece of text, you can ask questions like "does this match?", "show me every match", or "replace every match with something else." The syntax looks cryptic at first — ^\d{3}-\d{4}$ matches exactly a phone number like "555-1234" — but it's a thin abstraction over a small number of building blocks you only have to learn once.
The flags in one paragraph
g— global. Without this, you get the first match. With it, you get every match.i— ignore case./cat/imatches Cat, CAT, cAt.m— multiline.^and$match the start/end of each line instead of the whole string.s— dotall. The.metacharacter also matches newlines (by default it doesn't).u— unicode. Enables\p{...}property escapes and treats surrogate pairs as single characters.y— sticky. Each match must start exactly at lastIndex; rarely needed outside parser code.
When to reach for regex (and when not to)
Regex is great for: extracting structured patterns from unstructured text, validating simple formats (phone numbers, postal codes, ISBNs), replacing one pattern with another across a file, splitting strings on complex delimiters, and ad-hoc log analysis. Regex is a bad fit for: parsing nested structures like HTML or JSON (use a parser), fully validating email addresses (the RFC-compliant regex is absurd — use a library), and anything where the input grammar is actually a programming language.
Learn the syntax
Two dedicated references live here:
- Regex cheat sheet — every metacharacter, quantifier, anchor, group, and look-around, with examples you can paste into the tester above.
- Python regex cheat sheet — the Python
remodule: search / match / findall / sub semantics, flag names, Unicode handling, and the small syntax differences from JavaScript.
FAQ
What regex flavor does this tester use?
ECMAScript — the regex flavor built into JavaScript. That means it runs natively in your browser with no server round-trip and no WASM download. If you're testing patterns for a Node.js app, TypeScript project, browser form validation, or anywhere JavaScript regex runs, this is the right match. For PCRE, Python, Java, or .NET flavors, small syntax details differ (look-behind support, Unicode property escapes, named-group syntax); see our cheat sheets for the specifics.
Which regex flags are supported?
All six standard JavaScript flags: g (global — find all matches), i (ignore case), m (multiline — ^ and $ match line boundaries), s (dotall — . also matches newlines), u (unicode — enable full Unicode matching), y (sticky — anchor each match to lastIndex). Toggle them by clicking the flag pills or typing into the flag field after the pattern.
How do I use capture groups?
Wrap part of your pattern in parentheses, e.g. (\w+)@(\w+\.\w+) captures a username and domain from an email. Each match shows the full match plus every captured group on its own row with indices. In replacement mode, reference groups as $1, $2, etc. For named groups, use (?<name>...) and reference them as $<name>.
Why does my pattern not match newlines with the . metacharacter?
By default in JavaScript regex, the . metacharacter matches any character except line terminators (\n, \r, \u2028, \u2029). If you want . to also match newlines, enable the s flag (dotall). Alternatively, you can use a character class like [\s\S] which always matches any character including newlines.
What's the difference between match and replace mode?
Match mode shows every substring your pattern matches and breaks out the capture groups for each one. Replace mode takes your pattern, runs it against the test string, and substitutes matches with your replacement string. Replacements can reference capture groups via $1 / $2 / $<name>. Use match to understand what your regex captures; use replace to preview the transformation before running it in your real code.
Is anything I paste uploaded or logged?
No. Regex compilation and matching run entirely in your browser using the native JavaScript RegExp engine. No network request is made, no analytics event includes your pattern or test string. Your pattern, flags, and test string are persisted in localStorage so they're there next time you open the page; that data stays local.
What's catastrophic backtracking and how do I avoid it?
Certain regex patterns — especially nested quantifiers applied to ambiguous groups like (a+)+$ — can take exponentially long to fail on certain inputs. Your browser tab can freeze. To avoid it: prefer atomic groups where possible, rewrite alternations so they don't overlap, and when matching at the end of a string consider anchoring with a leading .*? instead of nested quantifiers. This tool caps match output at 10,000 results to prevent runaway loops but cannot catch all pathological patterns.
Does this work for email validation?
Short answer: probably not for production use. Email regexes that look simple (like the sample pattern on this page) fail on many valid edge cases — quoted local parts, IDN domains, IP literals, etc. The RFC-compliant email regex is about 300 characters long. For email validation, the correct approach is: (1) a permissive regex that catches obvious typos (missing @, no dot in domain), then (2) send a verification email. Regex alone isn't enough.
How is this different from regex101 or regexr?
This tool is intentionally simpler: one flavor (ECMAScript), no account required, no community patterns library, no code generator. It's the right tool if you want a fast browser-based match-and-replace check without signing up or loading a heavy IDE. regex101 is the better choice if you need PCRE/Python/Java flavors, regex debugging, or want to share patterns with a community.
Building something with regex? You might also want the UUID generator for identifier creation, or the LLM token counter for pricing AI prompts.