Regex Tester
Test regular expressions against text and inspect every match and group.
Updated: June 26, 2026
Test a regular expression instantly
Enter a pattern, choose your flags, paste some test text, and this tool shows
every match with its position and capture groups. It uses the browser's native
JavaScript regex engine, so what you see here is exactly how the pattern behaves
in RegExp, Node.js and the browser. Nothing is sent anywhere — test
freely with real data.
Flags you can use
g— global: find all matches, not just the first.i— case-insensitive.m— multiline:^and$match line starts/ends.s— dotall:.also matches newlines.u— unicode;y— sticky.
The tester always searches globally so you can see every match, then lists each one with its index and the contents of any capture groups.
Capture groups and named groups
Parentheses create capture groups you can reference later. (\w+)@(\w+)
captures the parts before and after an @. Named groups —
(?<user>\w+) — make patterns self-documenting and let you pull
values out by name. This tester displays both numbered and named groups for every
match, which is the fastest way to confirm your groups capture what you intend.
Tips for writing reliable patterns
- Anchor with
^and$when you mean to match a whole string. - Prefer specific character classes (
[a-z]) over a broad.. - Watch out for "catastrophic backtracking" with nested quantifiers like
(a+)+on long inputs. - Escape special characters (
. * + ? ( ) [ ] \) when you mean them literally.
Where it fits
Once your pattern works here, drop it straight into your code. Validating structured text? You might also want the JSON formatter or the URL encoder for the surrounding pipeline.
Frequently asked questions
Which regex flavor does this use?
It uses the JavaScript (ECMAScript) regex engine via the browser's native RegExp. Behavior matches Node.js and browser JavaScript exactly. Some syntax from PCRE/Python (like lookbehind variations) may differ.
Is my test text sent to a server?
No. Matching runs entirely in your browser, so you can safely test against sensitive or proprietary text.
How do I see capture groups?
Wrap parts of your pattern in parentheses. Each match in the results lists its numbered groups, and named groups (?<name>…) are shown by name too.
Why does my pattern match nothing?
Common causes are an unescaped special character, a missing flag (like i for case-insensitive), or anchors (^ $) that don't match your input. Build the pattern up piece by piece to isolate the issue.
Developer productivity tools
Regex is everywhere — these help you wield it safely:
- IDE with regex search & replace Run tested patterns across an entire codebase with live preview before you commit the change.
- Log analysis platform Apply regex parsing rules to extract fields from logs at scale, with alerting on matches.
Learn more
- 301 vs 302 Redirects: Which to Use (and Why It Matters for SEO) 301 or 302? The wrong choice can quietly tank your SEO. Here's what each redirect means, when to use it, and the chain mistakes to avoid.
- Regex Basics: A Beginner's Guide to Regular Expressions Regular expressions look like line noise until you learn the handful of building blocks. Here's the beginner's path, with examples you can test as you go.
- What Is the CSV Format? Delimiters, Quoting & Pitfalls CSV looks trivial until a comma appears inside a value. Here's how the format really works — delimiters, quoting rules, and the gotchas that corrupt data.
Related tools
- JSON Formatter & ValidatorBeautify, minify and validate JSON with clear error messages.
- URL Encode / DecodePercent-encode text for safe use in URLs, or decode %xx sequences back.
- Cron Expression ExplainerDecode any cron schedule into plain English and preview the next run times.
- YAML ↔ JSON ConverterConvert YAML to JSON and back, with clear parse errors.