Regex Generator

Generate regex patterns from example strings, test against samples, and browse a library of common patterns like email, URL, and phone number.

27.3Kuses
9/10(415)

Email Address

Matches standard email addresses

^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
user@example.comname.last@domain.co.uk

URL (http/https)

Matches HTTP and HTTPS URLs

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

Phone (US)

Matches US phone numbers in various formats

^\+?1?[-. ]?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4}$
+1 (555) 123-4567555-123-45675551234567

Phone (International)

Matches international phone numbers (E.164 format)

^\+?[1-9]\d{1,14}$
+14155552671+442071838750

IPv4 Address

Matches valid IPv4 addresses (0.0.0.0 to 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.110.0.0.1255.255.255.0

Hex Color

Matches hex color codes (3, 6, or 8 digit)

^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$
#fff#FF5733#FF573380

Date (YYYY-MM-DD)

Matches dates in ISO 8601 format

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

Date (MM/DD/YYYY)

Matches US-format dates

^(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])\/\d{4}$
03/24/202612/31/2025

Time (24h)

Matches 24-hour time format

^([01]\d|2[0-3]):[0-5]\d(:[0-5]\d)?$
14:3023:59:5900:00

Username

Alphanumeric, underscore, hyphen, 3-20 chars

^[a-zA-Z0-9_-]{3,20}$
john_doeuser-123CoolUser99

Strong Password

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

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

Credit Card

Matches Visa, Mastercard, Amex, Discover

^(?:4\d{12}(?:\d{3})?|5[1-5]\d{14}|3[47]\d{13}|6(?:011|5\d{2})\d{12})$
41111111111111115500000000000004

UUID v4

Matches UUID version 4 format

^[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

Slug

URL-friendly slug format

^[a-z0-9]+(?:-[a-z0-9]+)*$
my-blog-posthello-world-2026

HTML Tag

Matches opening and closing HTML tags

<([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>(.*?)<\/\1>
<div>content</div><p>text</p>

ZIP Code (US)

Matches 5-digit or 9-digit US ZIP codes

^\d{5}(-\d{4})?$
9021010001-1234

How to Use

  1. Use the Library tab to browse and copy common regex patterns.
  2. Use the Generator tab to input example strings and generate a matching regex.
  3. Use the Tester tab to test any regex against sample inputs.

Features

  • 16+ common regex patterns (email, URL, phone, UUID, etc.)
  • Pattern generator from example strings
  • Real-time regex tester with match highlighting
  • Support for regex flags (g, i, m, s)
  • Click to copy any pattern
  • 100% client-side, no data sent anywhere

Recommended Products

Ad

Affiliate Disclosure: As an Amazon Associate, ToolBird earns from qualifying purchases. Links above are affiliate links — if you buy through them, we may earn a small commission at no extra cost to you.

Disclaimer: This tool is provided as-is for informational and educational purposes only.

ToolBird Assistant

Find the right tool instantly

Hey! I'm ToolBird Assistant. Tell me what you need and I'll find the right tool for you.