🔍 Free Regex Tester & Debugger

Test regular expressions against sample text. See matches, capture groups, and test replacement.

Ad Space 160x600
Flags:

Regular expressions (regex) are patterns for matching text. Use \d for digits, \w for words, \s for spaces, + for one or more, * for zero or more.

Ad Space 160x600

🧰 Free Online Tools for Developers & Security

Free tools to generate, encode, convert, and secure your data..

MD5 Generator

Use Tool

SHA256 Generator

Use Tool

Base64 Encoder

Use Tool

JSON Formatter

Use Tool

URL Encoder

Use Tool

UUID Generator

Use Tool

QR Code Generator

Use Tool

Text Converter

Use Tool

HTML Encoder

Use Tool

JWT Debugger

Use Tool

Cron Parser

Use Tool

Password Strength Checker

Use Tool

Color Picker

Use Tool

Lorem Ipsum

Use Tool

Timestamp Converter

Use Tool

Regex Tester

Use Tool

Diff Checker

Use Tool

URL Parser

Use Tool

Hash Comparator

Use Tool

SSL Checker

Use Tool
Popular Tools

Real-time Testing

See matches and groups instantly

Replace Preview

Test regex replacements

Flags Support

g, i, m flags available

Local History

Last 5 regex patterns saved

What is Regular Expression (Regex) and Why Test It?

Regular expressions (regex or regexp) are sequences of characters that define search patterns. They're used for pattern matching, text validation, extraction, and replacement in strings. Think of regex as a powerful search language — instead of searching for exact text "cat", you can search for "any 3-letter word" or "any email address" or "any date format". Regex is supported in almost every programming language: JavaScript, Python, PHP, Java, C#, Ruby, Go, and many text editors like VS Code, Sublime, and Notepad++.

Common Regex Patterns and Uses

Email validation: \b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b. Phone numbers: \d{3}[-.]?\d{3}[-.]?\d{4}. URLs: https?:\/\/[^\s]+. Dates: \d{4}-\d{2}-\d{2}. IP Addresses: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b. Whitespace cleaning: \s+. HTML tags: <[^>]+>. Word boundaries: \bword\b.

Regex Syntax Basics

Literals: abc matches "abc". Metacharacters: . ^ $ * + ? { } [ ] \ | ( ). Character classes: \d (digit), \w (word), \s (whitespace), . (any char). Quantifiers: * (0+), + (1+), ? (0/1), {3} (exactly 3), {2,5} (2 to 5). Groups: ( ) captures group, (?: ) non-capturing. Anchors: ^ (start), $ (end), \b (word boundary). Flags: g (global), i (case-insensitive), m (multiline).

When to Use a Regex Tester

Debugging: Regex can be tricky. One wrong character breaks everything. Testers show you exactly what matches. Learning: See how patterns work in real-time. API Development: Test validation patterns before coding. Data Extraction: Try patterns on sample data before running on production. Text Processing: Test find-and-replace operations before executing on real files.

Why Our Regex Tester is Different

Most online regex testers send your patterns and data to servers — a serious privacy risk if you're testing sensitive data like passwords, API keys, or internal logs. Our tester runs entirely in your browser using JavaScript's RegExp engine. Your patterns and text never leave your computer. You can even disconnect from the internet — it still works perfectly.

Our tester shows every match with its index position. Capture groups are highlighted separately so you see exactly what each group captures. The replace feature lets you test find-and-replace operations with backreferences ($1, $2, etc.) to reference captured groups. Toggle the global flag to see all matches vs just the first match. Toggle case-insensitive for case-blind searches. Toggle multiline for ^ and $ to match line starts/ends instead of string start/end.

The example regex \b\w{5,}\b finds all words with 5 or more letters. Try changing it to \d+ to find numbers, or \S+@\S+ to find email addresses. Recent patterns are saved locally for quick reuse. Perfect for developers learning regex, debugging complex patterns, or validating input formats. Free, unlimited, completely private. Try it now — test a pattern and see matches highlight instantly.

📋 Recent Regex Patterns

Nothing here yet.

📝 Regex Cheatsheet — Quick Reference

\d — Any digit (0-9)
\w — Word char (a-z, A-Z, 0-9, _)
\s — Whitespace (space, tab, newline)
+ — One or more
* — Zero or more
? — Zero or one
^ — Start of string/line
$ — End of string/line
\b — Word boundary
[abc] — Any of a,b,c
[^abc] — Not a,b,c
(a|b) — Either a or b
{3} — Exactly 3 times
{2,5} — 2 to 5 times
{3,} — 3 or more
. — Any character
\. — Literal dot
\\ — Literal backslash

❓ Common Questions

Check: special characters need escaping (\. instead of .), flags like 'g' for multiple matches, and ensure your pattern matches your test data structure.
$1 refers to the first captured group (parentheses). $2 is the second group, etc. Use them to rearrange or modify matched text.
Try: \b[\w\.-]+@[\w\.-]+\.\w{2,}\b. But email regex can get very complex — this covers most common formats.