Build and test regular expressions with instant match highlights and capture group insights.
Pattern & Flags
Enter pattern without surrounding slashes. Supports ES2023 features including named groups and Unicode classes.
Toggle common flags: global, case-insensitive, multiline, dotall, Unicode, sticky.
Test Input
Match Results
✅
Matches Found
0
Flags: g
🧩
Named Groups
—
Detected capture group labels
🕒
Execution Time
—
Benchmark of the latest run
#
Match
Index
Length
Groups
💡 Notes
📖 How to Use
Enter your regex and sample text, toggle flags, and run the test to see highlighted matches and capture groups. Use presets to explore common patterns, and export results to share with your team.
🧮 Reference
Patterns combine literals, metacharacters (., *, +, ?, ^, $), character classes ([]) and grouping ().
Named captures use (?<name>...); backreferences access numbered or named groups.
Flags: g (global), i (ignore case), m (multiline), s (dotAll), u (Unicode), y (sticky).
Global matching iterates RegExp.prototype.exec and must advance when zero-length matches occur to avoid infinite loops.
💡 Tips
Anchor patterns with ^ and $ when matching entire strings.
Prefer non-greedy quantifiers (e.g., `.+?`) to avoid over-matching.
Use lookaheads/behinds for complex conditional logic.
Test against edge cases and include unit tests in your codebase.
🔗 References
ECMAScript 2023 Language Specification – Regular Expressions.
MDN Web Docs: JavaScript Regular Expressions Guide.
Regular-Expressions.info: Engine mechanics and best practices.