Regex Tester

Test JavaScript regular expressions and inspect matches and groups.

Test a JavaScript regular expression against sample text and inspect up to 100 matches.

Patterns use your browser's JavaScript regular expression engine. Test untrusted patterns carefully because complex patterns can freeze a browser tab.

How to use the regex tester

Enter a JavaScript regular expression pattern and sample text to see matches, positions, and captured groups. Flags such as i and m are optional.

Example

Pattern (cat|dog) against "cat and dog" returns two matches with their group values.

Good to know

Very complex patterns can freeze a browser tab. The tool shows at most 100 matches.