Regex Tester — Test Regular Expressions

Write a regex pattern, enter test text, and see matches highlighted in real time. Supports capture groups and replace mode.

100% Free No Account Works on Mobile
/ /
Matches Found
0
Output
Enter a pattern and test text to see matches.

How to Use the Regex Tester

Enter a regular expression pattern between the slashes, add flags (like g, i, m), and type or paste your test text. Matches are highlighted in real time. Use the Replace field to test regex substitutions.

Supported Flags

FlagDescription
gGlobal — find all matches, not just the first
iCase-insensitive matching
mMultiline — ^ and $ match start/end of each line
sDotall — . matches newline characters
uUnicode — treat pattern as Unicode

Common Regex Patterns

PatternMatches
\d+One or more digits
\w+@\w+\.\w+Simple email addresses
https?://[^\s]+URLs
\b[A-Z][a-z]+\bCapitalized words
(\d{3})-(\d{3})-(\d{4})Phone numbers (with groups)

Frequently Asked Questions

What regex flavor does this use?
JavaScript regex. This is the same regex engine used in browsers, Node.js, and most frontend code.
How do I use capture groups?
Wrap parts of your pattern in parentheses (). Each group is captured and shown in the Match Groups section. In replace mode, use $1, $2, etc. to reference groups.
Why is my regex not matching?
Check your flags — adding 'g' finds all matches, 'i' makes it case-insensitive. Also check for escaping: \d, \w, \s need the backslash. If you see an error message, your pattern syntax is invalid.