Back to Coding Tools

Regex Tester

Test and debug regular expressions with real-time matching

Regex Pattern
//
Test String341 chars
Matches1 match
Hello World! My email is john@example.com and my website is https://smarttoolbox.dev.

You can call me at (555) 123-4567 or +91-98765-43210.

Server IPs: 192.168.1.1, 10.0.0.1
Release date: 2025-03-25
Colors: #5046e5, #ff6b35, #2ecc71

<div class="container">
<h1>Welcome</h1>
<p>This is a sample paragraph with the number 42.</p>
</div>
Match Details
#MatchIndex
1john@example.com25

What is a Regex Tester?

A Regex Tester is a free online tool for building, testing, and debugging regular expressions in real-time. Type your regex pattern and test string, and the tool instantly highlights all matches, shows capture groups, and explains any errors. It supports JavaScript (ES2020+) regex syntax with all flags (g, i, m, s, u). Essential for developers working with text parsing, validation, and data extraction.

Why use a Regex Tester?

Regular expressions are powerful but notoriously tricky to get right. A missing character or misplaced quantifier can completely change the behavior. Testing regex in your IDE means constant save-compile-run cycles. This online tester gives you instant visual feedback — you can see exactly what your pattern matches, which groups are captured, and why a pattern might not be matching what you expect.

How to use the Regex Tester?

Enter your regex pattern in the pattern field and your test string below. The tool highlights matches in real-time, shows capture groups with their indices, displays match details, and provides a quick reference of common regex syntax. Toggle flags (global, case-insensitive, multiline, dotAll, unicode) to modify pattern behavior. Use the cheat sheet for quick syntax reference.

Common regex patterns

📧 Email Validation

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

📱 Phone Numbers

Pattern: ^\+?[1-9]\d{1,14}$ (E.164 international format)

🔗 URL Matching

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

🔐 Strong Password

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