Regex Tester
Run patterns with flags over text. View matches, groups, and positions.
Pattern
Text
Matches
How to Test Regular Expressions?
- Enter your regex pattern in the Pattern field (e.g.,
^\d{3}-\d{4}$). - Add flags in the Flags field (g=global, i=case-insensitive, m=multiline).
- Enter your test text in the Text area.
- Click Test to see matches highlighted and detailed results.
- View match positions, captured groups, and copy results as needed.
Frequently Asked Questions
What regex flavors are supported?
The tester uses JavaScript's built-in RegExp engine, which follows ECMAScript regex syntax. This is compatible with most modern languages for common patterns, though some advanced features (lookbehind in older browsers, possessive quantifiers) may differ.
How do I test a regex with multiple flags?
Enter your pattern in the Regex field and set flags separately: g (global โ find all matches), i (case-insensitive), m (multiline โ ^ and $ match line boundaries), and s (dotAll โ dot matches newlines). Combine flags as needed.
What are capture groups in regex?
Parentheses create capture groups that extract specific parts of a match. For example, (\d{4})-(\d{2})-(\d{2}) on "2024-01-15" captures the year, month, and day as separate groups visible in the match results.
How do I match special characters like dots or brackets?
Escape special regex characters with a backslash. A literal dot is \., a literal bracket is \[. Special characters in regex include: . * + ? ^ $ { } [ ] | ( ) \ โ all must be escaped to match literally.