Regex Tester
Test regular expressions with real-time matching
/
/
Matches: 0
Groups: 0
Common Patterns
Frequently Asked Questions
What is regex?
A pattern for matching text strings. Powerful for searching, validating, and manipulating text.
What flavors are supported?
JavaScript regex (ECMAScript), compatible with most modern languages.
How to learn regex?
Start with basics: . (any char), * (zero+), + (one+), [] (class), () (groups). Practice here.
What is the difference between greedy and lazy regex matching?
Greedy quantifiers (*, +) match as much text as possible. Lazy quantifiers (*?, +?) match as little as possible. For example, <.*> matches the entire string '', while <.*?> matches only ''.
How do I match an email address with regex?
A basic email regex is [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}. However, the full RFC 5322 email spec is extremely complex. For production use, prefer your language's built-in email validation.
Regex Quick Reference
. Any character except newline
\d Digit (0-9) \w Word character \s Whitespace
* 0 or more + 1 or more ? 0 or 1
^ Start of string $ End of string
[abc] Character class (abc) Capturing group
Flags
g Global - find all matches
i Case-insensitive matching
m Multiline - ^ and $ match line boundaries
s Dotall - . matches newlines too