Loading...
Build, test, and share regular expressions with a clean, developer-friendly interface. Write your pattern, paste test strings, and see line-by-line match results instantly. Save your regex as a shareable page so teammates can reference the same pattern, test cases, and explanation. Perfect for code reviews, documentation, onboarding guides, and quick regex validation. No signup required.
Validates that a string follows a standard email format: local part, @ symbol, domain, and TLD.
3/7
matches
/^[\w.-]+@[\w.-]+\.\w{2,}$/i
^ — Start of string
[\w.-]+ — One or more word chars, dots, or hyphens (local part)
@ — Literal @ symbol
[\w.-]+ — Domain name
\. — Literal dot before TLD
\w{2,} — TLD with 2+ characters
$ — End of string
This is a basic email regex. For production use, consider RFC 5322 compliance or use a dedicated email validation library.
Pick from beautiful, professional designs
Customize with your information
Get a link and QR code to share
Regex Tester comes packed with powerful features.
View your regex in a code-style format with forward slashes and flags, exactly as it appears in code.
Each line of your test string is checked against the pattern, showing a clear match or no-match indicator.
Save your regex, test strings, and explanation as a permanent page. Share the link with your team.
Monospace fonts, dark code blocks, and a clean layout designed for developers who live in the terminal.
Validates that a string follows a standard email format: local part, @ symbol, domain, and TLD.
3/7
matches
/^[\w.-]+@[\w.-]+\.\w{2,}$/i
^ — Start of string
[\w.-]+ — One or more word chars, dots, or hyphens (local part)
@ — Literal @ symbol
[\w.-]+ — Domain name
\. — Literal dot before TLD
\w{2,} — TLD with 2+ characters
$ — End of string
This is a basic email regex. For production use, consider RFC 5322 compliance or use a dedicated email validation library.
Matches international and domestic phone number formats with optional country code, parentheses, and separators.
4/7
matches
/^\+?[1-9]\d{0,2}[-.\s]?\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,9}$/
\+? — Optional plus sign for country code
[1-9]\d{0,2} — Country code (1-3 digits, no leading zero)
[-.\s]? — Optional separator
\(?\d{1,4}\)? — Optional parenthesized area code
Remaining groups match the local number with optional separators.
Phone validation is notoriously difficult. For production, use a library like libphonenumber.
Matches HTTP and HTTPS URLs with domain, optional path, and query parameters.
4/7
matches
/https?:\/\/[\w.-]+(?:\.[a-z]{2,})(?:\/[^\s]*)?/gi
https? — Match http or https
:\/\/ — Literal ://
[\w.-]+ — Domain name with subdomains
(?:\.[a-z]{2,}) — TLD (2+ chars)
(?:\/[^\s]*)? — Optional path and query string
This catches most common URLs but may miss edge cases like IP addresses or ports. For complete URL parsing, use the URL constructor.
Matches dates in ISO 8601 format (YYYY-MM-DD) with basic month and day validation.
3/7
matches
/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/
\d{4} — Four-digit year
(0[1-9]|1[0-2]) — Month 01-12
(0[1-9]|[12]\d|3[01]) — Day 01-31
Note: This does not validate days per month (e.g., Feb 30 passes).
For strict date validation, parse with new Date() after matching the format. This regex only validates the shape.
Validates that a password contains at least one lowercase letter, one uppercase letter, one digit, one special character, and is at least 8 characters long.
2/7
matches
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*]).{8,}$/
(?=.*[a-z]) — At least one lowercase
(?=.*[A-Z]) — At least one uppercase
(?=.*\d) — At least one digit
(?=.*[!@#$%^&*]) — At least one special char
.{8,} — Minimum 8 characters total
Password strength rules vary by application. NIST guidelines now recommend length over complexity. Consider a passphrase approach.
Matches opening and self-closing HTML tags with optional attributes. Does not match closing tags.
5/8
matches
/<([a-z][a-z0-9]*)\b[^>]*\/?>/gi
< — Opening angle bracket
([a-z][a-z0-9]*) — Tag name starting with a letter
\b — Word boundary
[^>]* — Any attributes (anything except >)
\/? — Optional self-closing slash
> — Closing angle bracket
Regex is not suitable for full HTML parsing. Use a proper DOM parser for production. This is useful for quick searches and simple extraction.
Validates IPv4 addresses with proper octet range checking (0-255 per octet).
5/8
matches
/^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/
(25[0-5]|2[0-4]\d|[01]?\d\d?) — Matches 0-255
\. — Literal dot separator
{3} — First three octets followed by dot
Final group matches the fourth octet without trailing dot.
This validates IPv4 only. For IPv6, you need a separate (much longer) pattern or use built-in parsing.
A simple word boundary matcher. Replace this with your own pattern.
3/3
matches
/\b\w+\b/g
\b — Word boundary
\w+ — One or more word characters
\b — Word boundary
This matches individual words in any text.
Replace this with your own pattern and test strings.
See how others use Regex Tester
Share a regex pattern with your team for review. Include test cases and an explanation so reviewers understand the intent.
Document validation patterns used in your codebase. Link directly to the test page from your docs.
Create a library of common regex patterns with explanations for new team members to reference.
Test a regex pattern against sample data before deploying it. Catch edge cases before they reach production.
Experiment with patterns and see results instantly. Add explanations to build your own regex reference.
Create unlimited Regex Testers for free. Need help? Our specialists are here.
Want a professionally designed Regex Tester? Our specialists will create it for you.
Helping businesses go digital, simply.
We believe every business deserves a powerful online presence. That's why we've built 100+ tools that are completely free, easy to use, and designed to get you online in minutes.
No technical skills required. No hidden fees. Just simple tools that work.
Discover other free tools
Free forever, no signup required. Start creating now.
Create Free Regex Tester