About Regex Tester
Test regular expressions with real-time highlighting of all matches. Supports all JavaScript RegExp flags (g, i, m, s, u, y). Shows a detailed match table with indices and capture groups. Includes a library of 12 common patterns for email, phone, URLs, dates, and more.
Regex Flags
g (global): Find all matches, not just the first. i (ignore case): Case-insensitive matching. m (multiline): ^ and $ match line boundaries. s (dotall): . matches newlines as well. u (unicode): Full Unicode support. y (sticky): Matches only at lastIndex position.
Match Display
Real-time highlighting of matches in the test string. Match table showing: Match text, Index position, Capture groups, Group names (if named groups used).
Common Patterns Library
Email: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$. Phone (India): ^[6-9]\d{9}$. Phone (US): ^\+?1?\s?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$. URL: ^https?://[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(/.*)?$. Date (YYYY-MM-DD): ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$. IP Address: ^(\d{1,3}\.){3}\d{1,3}$. Hex Color: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$. ZIP Code: ^\d{5}(-\d{4})?$. Username: ^[a-zA-Z0-9_-]{3,16}$. Password Strength: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$.