Regex Generator - Pattern Library
Generate ready-to-use regular expression patterns for common tasks. Browse categories including email validation, phone numbers, URLs, IP addresses, and more. Copy tested regex patterns instantly for use in JavaScript, Python, Java, and other languages.
Email Address
EmailMatch standard email format (RFC 5322 compatible)
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$International Phone Number
PhoneMatch international phone number with country code (E.164 format)
^\+?[1-9]\d{1,14}$URL
URLMatch HTTP/HTTPS URL format
^https?://[^\s/$.?#].[^\s]*$Domain Name
URLMatch domain name format (with TLD validation)
^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\.[a-zA-Z]{2,}$IP Address (IPv4)
URLMatch IPv4 address format (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?)$Date (YYYY-MM-DD)
DateMatch ISO 8601 date format
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$Time (HH:MM:SS)
DateMatch 24-hour time format
^([01]\d|2[0-3]):[0-5]\d:[0-5]\d$Datetime (YYYY-MM-DD HH:MM:SS)
DateMatch ISO 8601 datetime format
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]) ([01]\d|2[0-3]):[0-5]\d:[0-5]\d$Positive Integer
NumberMatch positive integers
^[1-9]\d*$Negative Integer
NumberMatch negative integers
^-[1-9]\d*$Integer (Signed)
NumberMatch signed integers (positive and negative)
^-?[1-9]\d*$Decimal Number
NumberMatch decimal numbers (signed, with optional fractional part)
^-?\d+(\.\d+)?$Password (8+ chars, letters+digits)
PasswordAt least 8 characters, must include letters and numbers
^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$Password (Strong)
PasswordAt least 8 chars, must include upper, lower, digit, and special char
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$Image File
FileMatch common image file extensions
.*\.(jpg|jpeg|png|gif|bmp|webp|svg)$Video File
FileMatch common video file extensions
.*\.(mp4|avi|mkv|mov|wmv|flv)$Document File
FileMatch common document file extensions
.*\.(pdf|doc|docx|xls|xlsx|ppt|pptx|txt)$HTML Tag
HTMLMatch HTML tags (opening and self-closing)
<[^>]+>HTML Attribute
HTMLMatch HTML attribute name="value" pairs
\w+="[^"]*"Whitespace
OtherMatch whitespace characters (spaces, tabs, newlines)
\s+Non-Whitespace
OtherMatch non-whitespace characters
\S+Regex Pattern Concepts and Boundaries
Quick Start Guide
Choose a pattern category based on the input format you need to validate or extract
Read what the pattern matches, which flags it uses, and which example inputs pass
Compare the pattern against invalid or borderline samples before using it in code
Test and adapt the expression in Regex Tester when your production input rules differ
💡Pro Tips
Frequently Asked Questions
Still have questions? Check out our other tools or contact us for support.
Related Tools
Regex Tester
Test regular expressions online with match, replace, split, capture group, flag, and highlighted result support
JSON Formatter
Format, compress, and validate JSON data
Find & Replace
Find and replace text across pasted documents, code snippets, lists, and drafts with case-sensitive matching, regex support, match counts, and instant preview