Regex Tester & Builder
Build, test, and debug regular expressions with real-time match highlighting, capture groups, replace preview, and a library of common patterns.
regexRegular Expression
text_fieldsTest String
targetMatch Results
find_replaceFind & Replace
library_booksCommon Regex Patterns
How to Test Regex Online
1. Enter Your Pattern
Type or paste your regular expression into the regex input field. Toggle flags like global, case-insensitive, or multiline to modify matching behavior.
2. Add Test String
Paste the text you want to test against. Matches are highlighted in real time so you can see exactly what your pattern captures.
3. Review Results
See all matches, their positions, and captured groups. Use the replace feature to preview substitutions, or copy results to your clipboard.
Regex Cheat Sheet
Character Classes
.Any character except newline\dDigit (0-9)\DNon-digit\wWord character (a-z, A-Z, 0-9, _)\WNon-word character\sWhitespace (space, tab, newline)\SNon-whitespace[abc]Any of a, b, or c[^abc]Not a, b, or c[a-z]Character range a to zQuantifiers & Anchors
*Zero or more+One or more?Zero or one (optional){n}Exactly n times{n,m}Between n and m times^Start of string / line$End of string / line\bWord boundary(abc)Capturing groupa|bAlternation (a or b)Common Regex Patterns
Email Regex Pattern
[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}Match email addresses. Click the quick-insert button above to test it instantly with your own data.
URL Regex Pattern
https?:\/\/[\w\-._~:/?#\[\]@!$&'()*+,;=%]+Match HTTP/HTTPS URLs. Click the quick-insert button above to test it instantly with your own data.
Phone Regex Pattern
\+?\d{1,4}[\s\-]?\(?\d{1,4}\)?[\s\-]?\d{1,4}[\s\-]?\d{1,9}Match phone numbers (international). Click the quick-insert button above to test it instantly with your own data.
IP Address Regex Pattern
\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\bMatch IPv4 addresses. Click the quick-insert button above to test it instantly with your own data.
Date Regex Pattern
\b\d{4}[\-/]\d{2}[\-/]\d{2}\b|\b\d{2}[\-/]\d{2}[\-/]\d{4}\bMatch dates (YYYY-MM-DD or MM/DD/YYYY). Click the quick-insert button above to test it instantly with your own data.
HTML Tag Regex Pattern
<\/?[a-zA-Z][a-zA-Z0-9]*(?:\s[^>]*)?\/?>Match HTML tags. Click the quick-insert button above to test it instantly with your own data.
Number Regex Pattern
-?\d+(?:\.\d+)?Match integers and decimals. Click the quick-insert button above to test it instantly with your own data.