Pattern lab
Regex Tester & Explorer
Debug email validators, log scrapers, named groups, and Unicode classes with instant highlights, match tables, and precise execution timing. Switch flags, load presets, and export proof straight into pull requests.
Author · Pawan
Reviewer · Kushal Singh
Enter pattern without slashes. Supports named captures, Unicode properties, lookarounds, and sticky mode.
Flags
Use multiline logs, JSON, or CSV. We run RegExp.prototype.exec safely and prevent runaway loops.
Presets
Results & highlights
Live counts, named groups, and execution benchmarks.
Matches found
0
Flags: g
Named groups
—
Shows (? labels when present.
Execution time
—
Measured via performance.now().
Highlighted matches
| # | Match | Index | Length | Groups |
|---|
Recommendations
Run the tester to populate matches, highlights, and export options.
Implementation checklist
- Scope inputs: Anchor patterns with
^and$when matching entire strings to avoid partial hits. - Escaping: Escape user-entered literals with
String.rawor helper functions to prevent regex injection. - Unicode: Turn on the
uflag when using property classes like\p{L}. - Performance: Watch execution time for catastrophic backtracking; simplify quantifiers if latency spikes.
FAQ
Can I test multiline logs?
Yes. Enable the m flag so ^ and $ anchor against every line inside the textarea.
How do I avoid catastrophic backtracking?
Prefer atomic groups, lazy quantifiers, or explicit character sets ([A-Za-z0-9]) when parsing long strings.
What does the CLI button do?
It copies a Node.js one-liner using your pattern, flags, and sample text so you can paste a repro into Slack or code review.
References
Author & Reviewer
Pawan designs developer-first calculators and linting helpers. His regex presets mirror the most common support tickets—emails, URLs, IDs—so teams can copy-paste working patterns.
Reviewed by Kushal Singh, AI Research Program Manager, for accuracy across ECMAScript 2024 features.