Regex Tester

Enter a regular expression and a test string to highlight matches in real time, and see the capture groups for each match.

//

What do the flags mean?

Common regex examples

Notes

This tool uses JavaScript's own regular expression engine. The pattern and test string you enter are processed entirely in your browser and are never sent to a server. Some syntax (such as the extent of lookbehind support) may differ from other languages' regex engines, like Python's or PCRE.

Frequently Asked Questions

How do I check capture groups?

Using parentheses ( ) in your pattern creates a capture group. Click any match in the match list to see the full matched string along with the value extracted for each group.

What happens if my regex is invalid?

If there's a syntax error in your pattern, an error message appears in the status bar. Check that your parentheses and brackets are balanced, and that special characters are escaped with a backslash (\) where needed.