Overview
Regular expressions are find-on-steroids: tiny patterns that describe whole families of text — every email address, every date, every HTML tag. Their power is matched only by their reputation for being unreadable, which is why testing them live matters. This page gives you a laboratory: pattern on top, test text below, matches highlighted the instant they appear.
The default example is an email pattern, because validating emails is the errand that sends most people to regex in the first place. Tweak it, break it, watch the highlights move — that feedback loop is how regex finally clicks.
What is a regular expression, really?
A pattern language for describing text shapes. Literal characters match themselves; special symbols describe classes (\d for digits), quantities (* for “zero or more”), positions (^ for “start of line”) and alternatives (a|b). Combined, a dozen characters can say “a word boundary, then letters, then an @ sign” — the email example above.
Flags tune the engine: g finds all matches instead of stopping at the first, i ignores case, m lets ^ and $ work per line, s lets the dot cross newlines. Capture groups — the parenthesised parts — do double duty: they group, and they remember what they matched, which is how “find and reformat” works.
Features
- Live highlighting of every match as you type the pattern.
- Flag toggles for g, i, m and s with instant effect.
- Match counter so you know exactly how many hits you got.
- Capture-group breakdown showing what each group grabbed.
- Clear error messages when the pattern is invalid, instead of silence.
- Zero-length match guard so patterns like a* cannot hang the page.
Benefits
- Learn by seeing: the highlight loop beats reading tutorials.
- Debug before you ship — test against real sample text first.
- Understand groups with the per-match breakdown.
- Safe experimentation: nothing to install, nothing uploaded.
Who can use it
Developers writing validators and parsers, data folks cleaning messy text, QA engineers testing input rules, students meeting regex for the first time, and anyone who has ever needed “find all the X” and found Ctrl+F insufficient. Copy a pattern from the internet and verify it here before trusting it.
How to use
- Enter your pattern in the expression box (or start from the email example).
- Toggle the flags you need: g, i, m, s.
- Paste your test text underneath.
- Watch matches highlight and check the count and group breakdown.
- Refine the pattern until it matches exactly what you intend — no more, no less.
Frequently asked questions
Why does my pattern match nothing?
The usual suspects: a missing flag (no g means it stops after the first match, which can look like nothing matched in a long text), case sensitivity (add i), or special characters in your pattern that need escaping with a backslash — . * + ? ( ) [ ] { } ^ $ | all have jobs in regex. The live highlight shows you instantly when a fix lands.
What are capture groups for?
Parentheses do two things: they group parts of a pattern together, and they capture — remember — what each group matched. That captured text can be reused in replacements (turning 2026-10-17 into 17/10/2026) or inspected, which is what the group breakdown panel shows you per match.
Is regex the right tool for validating emails?
Mostly no — the famous “perfect” email regex is pages long, and real validation means sending a confirmation email anyway. A simple pattern like the default example catches typos (missing @, no domain), which covers 99% of practical use. Do not let perfect be the enemy of the typo check.
Can a regex freeze my page?
Pathological patterns can — catastrophic backtracking, where nested quantifiers like (a+)+ make the engine try exponentially many paths. The tester guards against zero-length-match loops, but as a rule: keep patterns simple, avoid nested quantifiers, and test with long inputs before deploying.
Do I need to escape forward slashes?
Only in languages where the pattern is written between slashes, like JavaScript literals (/a\/b/). In this tester and in most tools you paste the raw pattern, so slashes are ordinary characters. When in doubt, test it and watch the highlight.
Conclusion
Regex rewards the tinkerer. Type, watch the highlights, adjust — the pattern that survives your test text is the pattern you can trust.