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
| Flag | Description |
|---|---|
| g | Global — find all matches, not just the first |
| i | Case-insensitive matching |
| m | Multiline — ^ and $ match start/end of each line |
| s | Dotall — . matches newline characters |
| u | Unicode — treat pattern as Unicode |
Common Regex Patterns
| Pattern | Matches |
|---|---|
\d+ | One or more digits |
\w+@\w+\.\w+ | Simple email addresses |
https?://[^\s]+ | URLs |
\b[A-Z][a-z]+\b | Capitalized 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.