Regex Library
Browse and copy common regular expressions for validation, extraction, and text processing
45 patterns
Email Address
ValidationMatches a standard email address format
URL
ValidationMatches http and https URLs with optional paths and query strings
IPv4 Address
ValidationMatches a valid IPv4 address (0β255 per octet)
IPv6 Address
ValidationMatches a full-form IPv6 address
Phone Number
ValidationMatches international and US phone numbers (loose format)
US ZIP Code
ValidationMatches 5-digit and ZIP+4 US postal codes
Strong Password
ValidationRequires uppercase, lowercase, digit, special char, min 8 chars
UUID / GUID
ValidationMatches RFC 4122 UUID format
Credit Card Number
ValidationMatches Visa, Mastercard, Amex, and Discover card numbers
Social Security Number
ValidationMatches US SSN format, excluding known invalid prefixes
Slug
ValidationMatches URL-safe slugs (lowercase, hyphens, no leading/trailing hyphens)
Username
ValidationStarts with a letter, 3β20 chars, allows letters, digits, underscores
Date (YYYY-MM-DD)
ExtractionExtracts ISO 8601 dates
Date (MM/DD/YYYY)
ExtractionExtracts US-format dates with capture groups for month, day, year
Time (HH:MM)
ExtractionExtracts 24-hour clock times
Time (HH:MM:SS)
ExtractionExtracts 24-hour times with seconds
Hex Color
ExtractionExtracts 3- or 6-digit hex color codes
Integer
ExtractionMatches positive or negative integers
Decimal Number
ExtractionMatches integers and floating-point numbers
Scientific Notation
ExtractionExtracts numbers in scientific notation
Currency (USD)
ExtractionExtracts US dollar amounts with optional cents
Twitter / X Handle
ExtractionExtracts @mention handles
Hashtag
ExtractionExtracts hashtags starting with a letter
Trim Whitespace
Text ProcessingMatches leading and trailing whitespace for removal
Collapse Multiple Spaces
Text ProcessingMatches two or more consecutive whitespace characters
Empty Lines
Text ProcessingMatches blank or whitespace-only lines
Repeated Words
Text ProcessingFinds accidentally duplicated consecutive words
HTML Tags
Text ProcessingMatches HTML element open/close pairs with content
HTML Comments
Text ProcessingMatches HTML comment blocks
Single-Line Comment (//)
Text ProcessingMatches C-style single-line comments
Single-Line Comment (#)
Text ProcessingMatches shell/Python-style single-line comments
Multi-Line Comment (/* */)
Text ProcessingMatches C-style block comments
Semantic Version
Code & DevMatches semver strings like 1.2.3, 1.0.0-beta.1
File Extension
Code & DevExtracts file extension from a filename or path
Environment Variable Name
Code & DevMatches POSIX-style environment variable names
SQL Identifier
Code & DevMatches valid SQL table and column names
CSS Class Selector
Code & DevExtracts CSS class selectors from a stylesheet
CSS ID Selector
Code & DevExtracts CSS ID selectors from a stylesheet
Camel to Snake Case
Code & DevFinds camelCase boundaries. Replace with $1_$2 and lowercase.
JWT Token
SecurityMatches a 3-part Base64URL-encoded JWT
Base64 String
SecurityMatches a standard Base64-encoded string
MAC Address
SecurityMatches colon- or hyphen-separated MAC addresses
CIDR Block
SecurityMatches IPv4 CIDR notation
AWS Access Key ID
SecurityDetects leaked AWS Access Key IDs in text or code
PEM Header
SecurityMatches PEM-encoded certificate or key headers