Pattern Matching Mastery

Master the Art of Regular Expressions

Explore, test, and discover regex patterns with our interactive tools. From email validation to complex parsing — find the perfect pattern.

0 Regex Patterns
0 Categories
0 % Free
regex_tester.js
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;

const test = "[email protected]";

if (emailRegex.test(test)) {
    // ✓ Valid email address
    console.log("Match found!");
}

Regex Tester

Test your regular expressions in real-time with instant visual feedback

/ /

Results

0 matches

Enter a regex pattern and test string to see matches

Pattern Visualization

Visualization will appear when you enter a pattern

Popular Patterns

Most commonly used regex patterns, ready to copy and use

📧

Email Address

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

Validates standard email format

🔗

URL

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

Matches HTTP and HTTPS URLs

📱

Phone Number (US)

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

US phone number formats

💳

Credit Card

^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13})$

Visa, Mastercard, Amex

🔐

Strong Password

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

Min 8 chars, upper, lower, number, special

📅

Date (YYYY-MM-DD)

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

ISO 8601 date format

🌐

IPv4 Address

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

Valid IPv4 address

#️⃣

Hex Color

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

3 or 6 digit hex color codes

Learn Regex

Master regular expressions from basics to advanced techniques

01

Basics

Learn the fundamental building blocks: literals, metacharacters, and simple patterns.

  • Character classes [abc]
  • Wildcards .
  • Anchors ^ $
02

Quantifiers

Control how many times patterns match with quantifiers and repetition.

  • Zero or more *
  • One or more +
  • Specific counts {n,m}
03

Groups & Captures

Group patterns together and capture matched content for extraction.

  • Capturing groups ()
  • Non-capturing (?:)
  • Named groups (?<name>)
04

Lookahead & Lookbehind

Advanced assertions for complex pattern matching scenarios.

  • Positive lookahead (?=)
  • Negative lookahead (?!)
  • Lookbehind (?<=) (?<!)