Regex Tool

Real-time pattern matching

Regular Expression Tool

Test, debug, and create your regex patterns with real-time matching, detailed results, and a comprehensive pattern library. Perfect for developers who work with regular expressions.

Pattern Library
Choose from common regex patterns. Use Pattern loads the regex, Try Example loads sample text.
Validation Mode: Patterns check if the entire string matches the format (perfect for form validation)

Email

Email & Communication

Validates if entire string is an email address

Example:
user@example.com

Email RFC 5322

Email & Communication

Comprehensive email validation (RFC 5322)

Example:
test.email+tag@example.co.uk

Phone US

Phone Numbers

Validates US phone number format

Example:
(555) 123-4567

Phone International

Phone Numbers

Validates international phone number (E.164)

Example:
+1234567890

URL HTTP/HTTPS

URLs & Web

Validates HTTP and HTTPS URLs

Example:
https://www.example.com/path?query=value

Domain Name

URLs & Web

Validates domain name format

Example:
example.com

IPv4 Address

URLs & Web

Validates IPv4 address format

Example:
192.168.1.1

Date YYYY-MM-DD

Dates & Time

Validates ISO date format

Example:
2023-12-25

Date MM/DD/YYYY

Dates & Time

Validates US date format

Example:
12/25/2023

Time 24-hour

Dates & Time

Validates 24-hour time format

Example:
14:30:00

Hex Color

Colors & Design

Validates hexadecimal color codes

Example:
#FF5733

RGB Color

Colors & Design

Validates RGB color format

Example:
rgb(255, 87, 51)

Credit Card

Numbers & Finance

Validates major credit card numbers

Example:
4532015112830366

Currency USD

Numbers & Finance

Validates US dollar amounts

Example:
$1,234.56

Social Security Number

Numbers & Finance

Validates US Social Security Number

Example:
123-45-6789

Variable Name JS/Python

Programming & Code

Validates JavaScript/Python variable names

Example:
myVariable_123

JSON String

Programming & Code

Validates JSON string format

Example:
"Hello World"

Username

Text & Content

Validates username format (3-16 chars)

Example:
user_name123

Strong Password

Text & Content

Validates strong password requirements

Example:
MyPass123!

ZIP Code US

Geographic

Validates US ZIP codes

Example:
12345-6789

Postal Code Canada

Geographic

Validates Canadian postal codes

Example:
K1A 0A6

MAC Address

Network & Security

Validates MAC addresses

Example:
00:1B:44:11:3A:B7

UUID

Network & Security

Validates UUID format

Example:
123e4567-e89b-12d3-a456-426614174000
Regex Cheat Sheet
Quick reference for regex patterns and syntax
Regular Expression
Enter your regex pattern and configure flags
Test String
Enter text to test against your regex pattern
Sample Texts:
Find & Replace
Replace matched patterns with new text
Use $1, $2, etc. for capture groups. Use $& for the entire match.
Export & Share
Save, load, or share your regex patterns
Import Text: Paste JSON data above, then click to import. Import File: Select a JSON file from your computer.
Results
Enter a pattern and test string to see results
Enter a regex pattern and test string to see matches

Comprehensive Regular Expression Testing and Debugging Tool

This regex testing tool provides a complete environment for creating, testing, and debugging regular expressions. Test patterns against sample text with real-time matching, view detailed match results with capture groups, and access a comprehensive library of pre-built patterns for common validation tasks including emails, phone numbers, URLs, dates, and more.

Key Features

  • Real-time Pattern Matching: See instant results as patterns are typed or test strings are modified
  • Pattern Library: Access 60+ pre-built regex patterns across 10 categories including email validation, phone numbers, URLs, dates, colors, credit cards, and more
  • Find & Replace: Test find-and-replace operations with regex patterns and see preview results before applying
  • Multiple Flags: Support for global, case-insensitive, multiline, dotAll, unicode, and sticky flags
  • Detailed Statistics: View match count, execution time, capture groups, and pattern complexity analysis
  • Export & Share: Generate code snippets in JavaScript, Python, PHP, Java, and other languages, or share patterns via URL
  • Cheat Sheet: Built-in reference guide for regex syntax, character classes, quantifiers, and special characters

Common Use Cases

Data Validation

Validate user input for emails, phone numbers, credit cards, passwords, and other formatted data

Text Extraction

Extract specific patterns from documents, logs, or web content such as URLs, dates, or identifiers

Search & Replace

Find and replace complex patterns in code, configuration files, or large text datasets

Code Analysis

Parse code to find variable names, function declarations, HTML tags, or JSON structures

Getting Started

  1. 1Choose a pattern from the library above or write a custom regular expression
  2. 2Enter test text in the input field or load a sample dataset
  3. 3View matches, capture groups, and statistics in real-time
  4. 4Adjust flags and refine the pattern as needed
  5. 5Export code or share the configuration with others