developer toolsPopular

Regex Pattern Generator & Tester

Instant regex pattern generator and tester for email validation, phone numbers, URLs, credit cards, IP addresses, and dates.

4.9 / 5(4120 votes)
Share:
Execution Mode
100% Client-Side In-Browser
Data Privacy
Zero Persistent Storage
Access Policy
Free · No Signup Required

Regex Pattern Library

Email Address

Matches standard email addresses

^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

URL

Matches HTTP/HTTPS URLs

^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$

Phone Number

Matches US phone numbers (various formats)

^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$

Date (YYYY-MM-DD)

Matches ISO 8601 date format

^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

IPv4 Address

Matches valid IPv4 addresses

^(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$

Credit Card

Matches major credit card formats

^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|6(?:011|5[0-9]{2})[0-9]{12}|(?:2131|1800|35\d{3})\d{11})$

Password Strength

Min 8 chars, 1 uppercase, 1 lowercase, 1 number, 1 special

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$

US ZIP Code

Matches 5-digit or 9-digit ZIP codes

^\d{5}(?:[-\s]\d{4})?$

Username

Alphanumeric and underscores, 3-16 chars

^[a-zA-Z0-9_]{3,16}$

HTML Tags

Matches simple HTML tags

<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>

Hex Color

Matches #RGB or #RRGGBB

^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$

Slug

URL-friendly slug (lowercase, hyphens, numbers)

^[a-z0-9]+(?:-[a-z0-9]+)*$

UUID/GUID

Matches UUID v1-v5 format

^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

How to Use Regex Pattern Generator & Tester

  1. 1

    Select a common pattern preset or write your regex pattern.

  2. 2

    Paste test text to see live highlights.

  3. 3

    Copy the regex pattern string and flags.

Key Features

  • Pre-built patterns for Email, URL, Phone, IP, Credit Card, Date, Password
  • Live regex test string matching
  • Regex flags builder (g, i, m, s)
  • Regex syntax explanation breakdown

Benefits

  • Stop re-writing common regex expressions from scratch
  • Test custom regex match groups interactively
  • Copy copy-paste ready regex for JS, Python, PHP

Common Pitfalls to Avoid

  • Forgetting global flag 'g' when matching multiple instances in a string.

Data Handling & Privacy Notice

This utility executes entirely client-side in your web browser. No text, calculations, or uploaded data are sent to our servers or stored in any database.

Frequently Asked Questions

/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/ is standard for email validation.

Guides & Articles for Regex Pattern Generator & Tester

View All Blogs →

Related developer tools