Regex Tester
Test a regular expression against sample text, with matches highlighted live.
What the common flags do
The "g" (global) flag finds every match instead of stopping at the first; "i" ignores letter case; "m" changes how ^ and $ behave across multiple lines; "s" lets a dot (.) match newline characters too.
Reading capture groups
Parentheses in a pattern create capture groups — useful for extracting a specific part of a match, like the domain from an email address, rather than just confirming the whole pattern matched.
Common Mistakes to Avoid
Forgetting to escape special characters
Solution:
Characters like . ( ) [ ] have special meaning in regex. Escape them with a backslash if you mean them literally.
Forgetting the "g" flag
Solution:
Without the global flag, only the first match is considered by some methods — enable it whenever you expect multiple matches.
Frequently Asked Questions
It makes the regex find every match in the text instead of stopping after the first one.
No — testing happens entirely in your browser.
What the common flags do
The "g" (global) flag finds every match instead of stopping at the first; "i" ignores letter case; "m" changes how ^ and $ behave across multiple lines; "s" lets a dot (.) match newline characters too.
Reading capture groups
Parentheses in a pattern create capture groups — useful for extracting a specific part of a match, like the domain from an email address, rather than just confirming the whole pattern matched.
