Regex Tester & Debugger - Test Regular Expressions Online Free
Regex Tester & Debugger
Test, debug, and visualize regular expressions in real time. See matches highlighted instantly, inspect capture groups, and use replace mode to transform text.
Private Instant No Limits Works Offline
//
Ctrl+Enter to test | Esc to clear
Matches: 0Time: 0msSteps: 0Testing...
Match Details
Email Address
[\w.+-]+@[\w-]+\.[\w.]+
URL
https?:\/\/[^\s<>\"]+
IPv4 Address
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
Phone Number (US)
\b\d{3}[-.]?\d{3}[-.]?\d{4}\b
Hex Color
#([0-9a-fA-F]{3}){1,2}\b
Date (YYYY-MM-DD)
\b\d{4}[-/]\d{2}[-/]\d{2}\b
HTML Tag
<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>
Proper Names
\b[A-Z][a-z]+(?:\s[A-Z][a-z]+)+
.Any char
\dDigit [0-9]
\wWord char
\sWhitespace
\bWord boundary
^Start of line
$End of line
*0 or more
+1 or more
?0 or 1
{n,m}n to m times
[abc]Char class
[^abc]Negated class
(abc)Capture group
(?:abc)Non-capture
a|bAlternation
(?=abc)Lookahead
(?!abc)Neg lookahead
(?<=a)Lookbehind
(?<!a)Neg lookbehind
(?<name>)Named group
\1Backreference
*?Lazy star
+?Lazy plus
How It Works
Type your regex pattern in the expression field
Toggle flags (g, i, m, s, u) as needed
Enter test text to see matches highlighted live
Inspect capture groups, indices, and named groups
Use Replace tab to test search-and-replace patterns
Features
Real-time match highlighting with color-coded groups
Full capture group inspection (named + positional)
Replace mode with $1, $2, $& substitution
Execution time and match count metrics
8 common pattern templates to start from
Complete regex cheatsheet reference
Copy all matches or replaced text to clipboard
100% client-side, no data leaves your browser
What is the Regex Tester?
This free online regex tester lets you write, test, and debug regular expressions in real time directly in your browser. As you type your pattern and test string, matches are highlighted instantly with color-coded capture groups, so you can see exactly what your regex matches without running any code. No uploads, no signups, and no data ever leaves your device.
Regular expressions are essential for text processing, data validation, and search operations, but writing them correctly is notoriously tricky. This tool gives developers, data analysts, and writers a fast way to experiment with patterns, verify they work on real input, and debug issues before deploying regex in production code.
How to Use This Tool
Follow these steps to test regular expressions with this free online regex debugger:
Enter your pattern - Type your regular expression in the pattern field between the delimiters. The tool validates syntax in real time and shows errors instantly if your pattern is invalid.
Set your flags - Toggle the flag buttons (g for global, i for case-insensitive, m for multiline, s for dotall, u for unicode) to control matching behavior.
Paste your test string - Enter or paste the text you want to match against. Matches highlight immediately as cyan markers overlaid on your text.
Inspect results - Scroll through the Match Details panel to see each match with its index position, length, and captured groups (both named and positional). Switch to the Replace tab to test substitution patterns using , , or $& references, then copy the result.
Key Features
Real-time match highlighting - Matches appear as colored overlays on your test string the moment you type, with distinct colors for different capture groups.
Full capture group inspection - View every positional and named capture group for each match, along with index positions and match lengths.
Search and replace mode - Test replacement patterns with full support for backreferences (, , $&) and instantly preview the transformed output.
8 built-in pattern templates - Start from common patterns for email addresses, URLs, IPv4 addresses, US phone numbers, hex colors, dates, HTML tags, and proper names.
Interactive regex cheatsheet - A complete reference of regex syntax (quantifiers, character classes, assertions, lookaheads, named groups) available in one click.
Performance metrics - See match count, execution time in milliseconds, and step count to identify potentially slow or catastrophic backtracking patterns.
Works entirely offline - Runs 100% in your browser with zero network requests. Your test data never leaves your machine.
Common Use Cases
Developers use this regex tester to validate patterns before adding them to code, catching edge cases with real sample data rather than guessing. Data engineers test extraction patterns for log parsing, ETL pipelines, and data cleaning workflows. QA testers verify that form validation regex correctly accepts valid inputs and rejects malformed ones (emails, phone numbers, postal codes). Technical writers and content teams use it to perform bulk find-and-replace operations on documentation, testing substitution patterns before running them across large files.
Frequently Asked Questions
Is my test data sent to a server?
No. This regex tester runs entirely in your browser using JavaScript. Your patterns and test strings are never transmitted anywhere. You can even disconnect from the internet and the tool continues to work, making it safe for testing patterns against sensitive data like API keys or personal information.
Which regex flavor does this tool use?
It uses JavaScript's built-in RegExp engine, which supports ECMAScript 2018+ features including named capture groups (?<name>), lookbehind assertions (?<= ), the dotall flag (s), and Unicode property escapes (with the u flag). Patterns you test here will work directly in JavaScript, TypeScript, and most modern browsers.
What do the flag buttons (g, i, m, s, u) do?
Each flag modifies matching behavior. g (global) finds all matches instead of stopping at the first. i (case-insensitive) ignores letter case. m (multiline) makes ^ and $ match at line boundaries, not just the start and end of the entire string. s (dotall) makes the dot (.) match newline characters. u (unicode) enables full Unicode matching and makes quantifiers work correctly with surrogate pairs.
How do I use capture groups in the Replace tab?
Switch to the Replace tab and enter your substitution string using backreferences: inserts the first capture group, the second, and so on. Use $& to insert the entire match. For named groups, use $<name>. For example, with pattern (\d{4})-(\d{2})-(\d{2}) and replacement //, the date 2026-05-09 becomes 05/09/2026.
Why does my regex show a high step count or run slowly?
A high step count usually indicates catastrophic backtracking, where nested quantifiers cause the engine to explore an exponential number of paths. Common culprits include patterns like (a+)+ or (.*a){10}. The tool caps execution at 10,000 steps to prevent browser hangs. To fix this, use atomic groups, possessive quantifiers (where supported), or rewrite the pattern to be more specific about what it matches.