Regex Tester
Test regular expressions against sample text in the browser. See all matches, indices, and groups. Invalid regex patterns show a clear error.
Regex Tester tool
How to use
Enter pattern and flags
Type your regular expression in the pattern field. Add flags (e.g. g for global, i for case-insensitive) in the flags field.
Enter test text
Paste or type the string you want to test against. The tool will list all matches.
Review matches
Each match shows the matched text, index, and any capture groups. Invalid regex syntax is reported as an error.
Examples
Email-like pattern
Find substrings that look like email addresses.
InputContact us at [email protected] or [email protected]OutputMatches: [email protected], [email protected]
Frequently asked questions
- Which regex flavor is used?
- The tool uses JavaScript's native RegExp, so it follows ECMAScript regex rules. Lookahead, capture groups, and standard character classes are supported.
- Why does my pattern show an error?
- Invalid syntax (e.g. unescaped brackets, invalid quantifiers) causes the engine to throw. Check your backslashes and special characters and try again.
Related tools
You might find these useful too.