About this tool
Live regex matching with match highlights and groups.
The Regex Tester evaluates a JavaScript regular expression against a test string in real time. As you type the pattern, all matches are highlighted in the test string and each match with its capture groups is listed below. Supports all JavaScript regex flags: g (global), i (case-insensitive), m (multiline), s (dotAll), u (Unicode) and y (sticky).
Example
Pattern: \b\w+@\w+\.\w+\b · Text: "email me@test.com please"
Match: me@test.com
How to use
- Type your regex pattern in the Pattern field.
- Enter the test string in the main area.
- Matches highlight immediately.
- Capture groups are listed below each match.
Features
- Live match highlighting
- Capture group extraction
- All JS flags: g i m s u y
- Match count and character positions
- Regex quick-reference panel
Frequently Asked Questions
What regex flavour is used?+
JavaScript (ECMAScript) regex — the engine used in Chrome, Firefox, Safari and Node.js. Syntax is compatible with most modern regex tools.
How do I match across line breaks?+
Enable the m flag (multiline) to make ^ and $ match line starts/ends. Enable the s flag (dotAll) to make . match newline characters.
Why does my regex cause a timeout?+
Catastrophic backtracking can freeze on complex nested quantifiers. Simplify the pattern or reduce the test input.
Can I extract named capture groups?+
Yes. Both named groups (?<name>...) and indexed groups are extracted and displayed.
What flags are supported?+
Standard JavaScript flags: g (global), i (case-insensitive), m (multiline), s (dotAll), u (Unicode), y (sticky). Enter them in the flags field.
How do I match a literal dot?+
Escape it: \.. An unescaped dot matches any character. To match a period in an email address, use \. not ..