Regex Tester
Test and debug regular expressions in real-time. See matches highlighted, capture groups extracted, and common patterns preloaded.
Test and debug regular expressions in real-time with instant match highlighting
/
Matches (0)
Enter a regex pattern to start
All testing happens locally in your browser. Regular expressions use JavaScript syntax. Use backslash (\\) to escape special characters.
How to Use This Tool
- 1
Enter your regex pattern
Type your regular expression in the pattern field. No need to add surrounding slashes — just the pattern itself.
- 2
Select flags
Toggle flags like g (global), i (case-insensitive), m (multiline), or s (dotall) to modify how the regex behaves.
- 3
Add test text
Paste or type text in the test string area. Matches will be highlighted in yellow as you type.
- 4
Review matches
See all matches listed with their index positions and capture groups. Click any match to copy it.
Frequently Asked Questions
- What regex flavor does this tool use?
- This tool uses JavaScript's built-in RegExp engine. Most standard regex syntax is supported, including lookahead, lookbehind (in modern browsers), and Unicode escapes.
- What do the flags mean?
- g (global) finds all matches instead of stopping at the first. i (case-insensitive) ignores letter case. m (multiline) makes ^ and $ match line starts/ends. s (dotall) makes . match newlines.
- How do I match special characters?
- Escape special regex characters with a backslash. For example, to match a literal period, use \. To match a backslash, use \\. Special characters include: . * + ? ^ $ { } [ ] \ | ( )
- What are capture groups?
- Parentheses () create capture groups that extract parts of a match. For example, (\d+)-(\d+) matching '123-456' captures '123' and '456' as separate groups.