Email & Contact
Email Address
Validates standard email addresses
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
US Phone Number
US phone numbers with optional country code and separators
^(\+1)?[\s.-]?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$
(555) 123-4567
12345
International Phone
International phone numbers (E.164 format)
^\+?[1-9]\d{6,14}$
+447911123456
+0123
URLs & Web
URL (HTTP/HTTPS)
HTTP and HTTPS URLs
^https?://[^\s/$.?#].[^\s]*$
https://example.com/path?q=1
ftp://files.com
Domain Name
Valid domain names
^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$
sub.example.com
-invalid.com
Slug (URL-friendly)
URL slugs — lowercase alphanumeric with hyphens
^[a-z0-9]+(?:-[a-z0-9]+)*$
my-blog-post
My Blog Post
IPv4 Address
Valid IPv4 addresses (0.0.0.0 — 255.255.255.255)
^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$
192.168.1.1
256.1.1.1
IPv6 Address
Full IPv6 addresses (no shorthand)
^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$
2001:0db8:85a3:0000:0000:8a2e:0370:7334
::1
Data Formats
UUID v4
UUID version 4 (random)
^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
550e8400-e29b-41d4-a716-446655440000
not-a-uuid
ISO 8601 Date
Dates in YYYY-MM-DD format
^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$
2024-03-15
03/15/2024
ISO 8601 DateTime
Full ISO 8601 datetime with timezone
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$
2024-03-15T14:30:00Z
2024-03-15 14:30:00
JSON String
Valid JSON string with escaped characters
^"(?:[^"\\]|\\.)*"$
"hello \"world\""
"unclosed
Hex Color Code
CSS hex color codes (#RGB or #RRGGBB)
^#(?:[0-9a-fA-F]{3}){1,2}$
#ff5733
#xyz
Semantic Version
SemVer (e.g., 1.0.0, 2.1.3-beta.1)
^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([\da-zA-Z-]+(?:\.[\da-zA-Z-]+)*))?(?:\+([\da-zA-Z-]+(?:\.[\da-zA-Z-]+)*))?$
1.2.3-beta.1
v1.2
Passwords & Security
Strong Password
Min 8 chars, uppercase, lowercase, digit, special char
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
Str0ng!Pass
weak
JWT Token
JSON Web Token (3 base64url segments)
^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$
eyJhbG.eyJzdW.SflKxw
not.a.jwt.token.here
Numbers & Currency
Integer
Positive or negative integers
^-?\d+$
-42
3.14
Decimal / Float
Decimal numbers with optional fractional part
^-?\d+\.?\d*$
3.14159
abc
US Currency
US dollar amounts with commas and cents
^\$\d{1,3}(,\d{3})*(\.\d{2})?$
$1,234.56
1234.5
Credit Card (Visa)
Visa card numbers (13 or 16 digits starting with 4)
^4\d{12}(?:\d{3})?$
4111111111111111
5111111111111111
Identity & Codes
US Social Security
US SSN format (XXX-XX-XXXX)
^\d{3}-\d{2}-\d{4}$
123-45-6789
1234-5-6789
US Zip Code
5-digit or ZIP+4 format
^\d{5}(-\d{4})?$
90210-1234
ABCDE
MAC Address
Network MAC addresses with : or - separator
^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$
00:1A:2B:3C:4D:5E
001A2B3C4D5E
Code & Programming
Variable Name
Valid JS/Python/Java variable name
^[a-zA-Z_$][a-zA-Z0-9_$]*$
_myVar123
123abc
HTML Tag
Matches paired HTML tags with content
<([a-z][a-z0-9]*)\b[^>]*>(.*?)</\1>
<div>hello</div>
<br/>
Import Statement (JS)
JavaScript/TypeScript import statements
^import\s+.*\s+from\s+['"].*['"];?$
import React from 'react';
require('react')
Text & Content
Whitespace Trim
Leading and trailing whitespace (use with replace)
^\s+|\s+$
hello
hello
Duplicate Words
Repeated consecutive words
\b(\w+)\s+\1\b
the the quick
the quick brown
Markdown Link
Markdown hyperlinks [text](url)
\[([^\]]+)\]\(([^)]+)\)
[Click here](https://example.com)
plain text
Regex Pattern Library is a Pro tool
Unlock this tool and all Pro features for just $5/month.
Upgrade to ProCancel anytime · All 15 free tools stay free forever
Related Tools
Sponsored Links
Advertisements