Regular Expression Tester

Test and validate your regular expressions (regex) in real time. Free tool for developers with the g, i, m, s and u flags and captured group display.

100% local processing — nothing leaves your browser.Learn more

Options (Flags)

Quick Examples:

\d+ → Integer numbers
\w+@\w+\.\w+ → Email addresses (simple)
#[0-9A-Fa-f]{6} → Hexadecimal colors
^https?:// → HTTP/HTTPS URLs
\b[A-Z]{2,}\b → Acronyms (2+ uppercase letters)

Regex Tester: Test and Debug Regular Expressions Online

The Regex Tester is a free online tool for developers to test, debug, and learn regular expressions in real-time. With instant match highlighting, capture group visualization, and flag support, this tool makes working with regex patterns intuitive and efficient.

Regular expressions (regex) are powerful patterns for text matching, validation, and transformation. However, their cryptic syntax makes debugging challenging. This tool provides immediate visual feedback as you type, helping you understand exactly how your pattern matches your test text.

💡 Why Use an Online Regex Tester?

Writing regex without visualization is like coding without debugging. A minor syntax error can completely change what your pattern matches. This tool shows matches instantly as you type, making it easy to iteratively refine your patterns.

Beyond matching, it displays capture groups, highlights each match in your text, and supports the common flags (global, case-insensitive, multiline, dotAll, unicode). Perfect for building validation patterns, extraction rules, or find-and-replace operations.

🎯 Typical Use Case:

You need to extract email addresses from a document. Instead of writing and testing regex in your code, you paste the text here, build your pattern iteratively, and see exactly what it captures before implementing.

🔧 Practical Use Cases

📧 Email Validation

Test email validation patterns against various edge cases (enable the m flag to test one address per line).

^[\w.-]+@[\w.-]+\.\w{2,}$

🔗 URL Extraction

Extract every URL from text content (g flag); the group is non-capturing, so each whole URL is returned as a match.

https?://[\w.-]+(?:/[\w.-]*)*

📞 Phone Number Formatting

Match North American numbers (3-3-4 digits) in various formats, such as +1 (555) 123-4567, 555.123.4567 or 5551234567; group 1 captures the country code.

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

📝 Log Parsing

Extract timestamps, levels, and messages from log files such as [2024-11-15 14:23:45] ERROR: Connection timeout (flags g and m, one entry per line).

^\[(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})\]\s+(\w+):\s+(.*)$

✨ Supported Flags

g - Global

Find all matches, not just the first one.

i - Case Insensitive

Match both uppercase and lowercase letters.

m - Multiline

^ and $ match start/end of each line.

s - Dotall

Allow . to match newline characters.

u - Unicode

Full Unicode mode: \u{...} escapes, \p{...} property classes, and an emoji such as 😀 counts as one character.

The g flag is enabled by default. The y (sticky), d (indices) and v (unicodeSets) flags are not available in this tool.

❓ Frequently Asked Questions (FAQ)

Which regex flavor does this tool use?

This tool uses JavaScript's RegExp engine, which is compatible with most web development use cases. Syntax may differ slightly from PCRE (Perl-compatible) or other flavors like Python or Java regex.

How do capture groups work?

Parentheses () create capture groups that extract specific parts of the match. For example, (\d{4})-(\d{2})-(\d{2}) captures year, month, and day separately from a date string.

Can I test replace operations?

Currently this tool focuses on matching and capturing. For replace operations, you can use the captured groups in your code: text.replace(/pattern/, '$1-$2') uses capture groups in the replacement.

📖 Resources & Documentation

📄 MDN Regular Expressions

Complete JavaScript regex guide with examples.

Read the guide →

📘 Regex Cheat Sheet

Quick reference for common regex patterns.

View cheat sheet →
🥝Buy me a kiwi !