Regex Tester

Test and debug regular expressions with real-time matching, interactive flag controls, and a growing library of copy-and-paste patterns for email, URLs, GitHub repositories, phone numbers, and more.

Enter a regex pattern and some text below. Matches will be highlighted automatically.

Regular Expression Pattern

/

Test Your Pattern

Preset loaded: Email Address

3 matches

Input Text

Highlighted Matches

Contact support@example.com, hello@chatdb.ai, or marketing.team+newsletter@company.co.uk for help. Troublesome addresses such as user@@example or missing@tld will not be matched.

Pattern Library & Examples

Load battle-tested regex for email addresses, GitHub repositories, URLs, phone numbers, UUIDs, and other everyday data formats. Each preset includes copy-ready text so you can verify matches instantly.

Email Address

Matches typical email addresses, including subdomains and plus aliases, while avoiding most invalid strings.

\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b
#email#validation#contact

Example Matches

  • support@example.com
  • marketing.team+newsletter@company.co.uk

Website URL (HTTP/HTTPS)

Captures full HTTP or HTTPS URLs with optional subdomains, ports, paths, and query parameters.

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

Example Matches

  • https://www.chatdb.ai/tools/regex-tester
  • http://example.com?ref=promo

GitHub Repository URL

Targets canonical GitHub repository URLs for organisations or users, allowing dots and dashes in names.

^https?:\/\/(?:www\.)?github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/?$
#github#repository#developer

Example Matches

  • https://github.com/vercel/next.js
  • https://github.com/facebook/react

North American Phone Number

Matches U.S. and Canadian phone numbers with optional country code, separators, or parentheses.

\b(?:\+1[-.\s]?)?(?:\(\d{3}\)|\d{3})[-.\s]?\d{3}[-.\s]?\d{4}\b
#phone#contact#validation

Example Matches

  • 415-555-1234
  • (212) 555 7788
  • +1 646.555.9012

IPv4 Address

Matches IPv4 addresses while constraining each octet to the 0–255 range.

\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b
#ip#networking#infrastructure

Example Matches

  • 192.168.0.10
  • 10.0.0.5
  • 8.8.8.8

UUID (v4 compatible)

Finds UUID strings (version 1-5) typically used for database keys and API identifiers.

\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}\b
#uuid#id#api

Example Matches

  • 3f2504e0-4f89-11d3-9a0c-0305e82c3301
  • 2c1a1d60-5f54-4d89-b3f7-7a1b3a6c22ed

SEO-Friendly Slug

Ensures lowercase URL slugs that use hyphens between words without trailing separators.

^[a-z0-9]+(?:-[a-z0-9]+)*$
#seo#slug#cms

Example Matches

  • regex-tester
  • marketing-automation-2025
  • ai

ISO 8601 Date (YYYY-MM-DD)

Captures ISO-formatted calendar dates, ideal for datasets and API payloads.

\b\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])\b
#date#iso#scheduling

Example Matches

  • 2025-10-28
  • 2026-01-01
  • 2024-12-15

Why Use a Regular Expression Tester?

Regular expressions (regex) are powerful pattern-matching tools used in programming, data validation, and text processing. Our regex tester helps you develop and debug patterns efficiently:

  • Test regex patterns in real-time with instant feedback
  • Visualize matches with highlighting and detailed information
  • Debug complex patterns with capture group analysis
  • Experiment with different flags and modifiers
  • Validate data formats like emails, URLs, and phone numbers
  • Learn regex through interactive examples and common patterns
  • Save time during development and debugging

How to Use This Regex Tester

Using our regex tester is straightforward:

  1. Enter your regular expression pattern in the pattern field
  2. Add flags (g, i, m, s, u, y) as needed for your use case
  3. Input or paste your test string in the test area
  4. View highlighted matches and detailed match information
  5. Click on matches to see capture groups and named groups
  6. Use common patterns as starting points for your own regex

Regular Expression Flags Explained

Regex flags modify how the pattern matching works:

  • g (Global): Find all matches, not just the first one
  • i (Ignore Case): Make the pattern case-insensitive
  • m (Multiline): ^ and $ match line breaks, not just string start/end
  • s (Dot All): . matches newline characters
  • u (Unicode): Enable full Unicode support
  • y (Sticky): Match only from the lastIndex position

Common Regex Use Cases

Regular expressions are essential in many development scenarios:

  • Form validation (emails, phone numbers, passwords)
  • Data extraction from text files and logs
  • Search and replace operations in code editors
  • URL routing and parameter extraction
  • Input sanitization and security filtering
  • Log file analysis and monitoring
  • Data parsing and transformation
  • Text processing and content analysis

Copy-and-Paste Regex for Popular Formats

Use these ready-made patterns to accelerate your workflow. Each regex is battle-tested for common SEO and data tasks, from validating email submissions to confirming GitHub repository URLs.

Regex for Email Address

Matches typical email addresses, including subdomains and plus aliases, while avoiding most invalid strings. Ideal for Form and newsletter opt-in validation, Email list hygiene for marketing imports, Filtering contact information from documents.

Pattern
\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b
Example Matches
  • support@example.com
  • marketing.team+newsletter@company.co.uk

Regex for Website URL (HTTP/HTTPS)

Captures full HTTP or HTTPS URLs with optional subdomains, ports, paths, and query parameters. Ideal for Scraping or validating web links in content, Auto-linking URLs in CMS or chat applications, SEO audits that need to locate unsecured http links.

Pattern
https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)
Example Matches
  • https://www.chatdb.ai/tools/regex-tester
  • http://example.com?ref=promo

Regex for GitHub Repository URLs

Targets canonical GitHub repository URLs for organisations or users, allowing dots and dashes in names. Ideal for Populate curated GitHub lists, Validate user-submitted repository fields, Extract repos from documentation or blog posts.

Pattern
^https?:\/\/(?:www\.)?github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/?$
Example Matches
  • https://github.com/vercel/next.js
  • https://github.com/facebook/react

Regex for Phone Numbers

Matches U.S. and Canadian phone numbers with optional country code, separators, or parentheses. Ideal for Form validation for contact or checkout flows, Normalizing call lists for outbound teams, Detecting phone numbers in support transcripts.

Pattern
\b(?:\+1[-.\s]?)?(?:\(\d{3}\)|\d{3})[-.\s]?\d{3}[-.\s]?\d{4}\b
Example Matches
  • 415-555-1234
  • (212) 555 7788
  • +1 646.555.9012

Regex for IPv4 Address

Matches IPv4 addresses while constraining each octet to the 0–255 range. Ideal for Log parsing and analytics, Firewall configuration checks, Data masking for exported reports.

Pattern
\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b
Example Matches
  • 192.168.0.10
  • 10.0.0.5
  • 8.8.8.8

Regex for UUID (v4 compatible)

Finds UUID strings (version 1-5) typically used for database keys and API identifiers. Ideal for Database audits and migrations, API payload validation, Debugging distributed tracing logs.

Pattern
\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}\b
Example Matches
  • 3f2504e0-4f89-11d3-9a0c-0305e82c3301
  • 2c1a1d60-5f54-4d89-b3f7-7a1b3a6c22ed

Regex for SEO-Friendly Slugs

Ensures lowercase URL slugs that use hyphens between words without trailing separators. Ideal for Content management systems, E-commerce product URL validation, SEO tooling and audits.

Pattern
^[a-z0-9]+(?:-[a-z0-9]+)*$
Example Matches
  • regex-tester
  • marketing-automation-2025
  • ai

Regex for ISO 8601 Date (YYYY-MM-DD)

Captures ISO-formatted calendar dates, ideal for datasets and API payloads. Ideal for Event scheduling data, API request validation, Spreadsheet cleanup.

Pattern
\b\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])\b
Example Matches
  • 2025-10-28
  • 2026-01-01
  • 2024-12-15

Features of Our Regex Tester

  • Real-time pattern testing with instant results
  • Visual highlighting of matches in the test string
  • Detailed match information with capture groups
  • Support for all JavaScript regex flags
  • Interactive flag toggles with descriptions
  • Common pattern library for quick testing
  • Error handling and validation feedback
  • Copy pattern functionality
  • Completely free with no registration required
  • Privacy-focused - all processing happens in your browser