Regex Tester

Regex Tester

Test and debug regular expressions in real time. Highlights matches, shows capture groups, supports all JavaScript regex flags, and includes a substitution mode.

Live Match Highlighting Capture Groups Global/Ignore case/Multiline Flags Substitution Mode Match Count
Get started free Sign in

Free · No credit card · 50 credits/day

Everything You Need to Debug Regex

From basic pattern matching to advanced lookaheads — all the tools to master regular expressions.

Match Mode
Instantly see every match highlighted in your test string as you type.
Replace Mode
Preview substitutions with $1 backreferences before applying them.
Named Groups
Use (?<name>…) syntax and see each capture by name in the results panel.
Flags Explained
g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode) — each toggled with a single click.
Lookahead / Lookbehind
Craft zero-width assertions ((?=…) (?!…) (?<=…) (?<!…)) and confirm they match without consuming characters.
Character Class Shortcuts
Quick reference for \d \w \s \b and their uppercase negations built into the sidebar.

Frequently Asked Questions

What do the regex flags g, i, m, s, u do?
The g (global) flag finds all matches instead of stopping at the first. The i flag makes matching case-insensitive. The m (multiline) flag makes ^ and $ match the start and end of each line rather than the whole string. The s (dotAll) flag makes . match newlines. The u flag enables full Unicode support, treating the pattern as a sequence of Unicode code points.
What is the difference between greedy and lazy quantifiers?
Greedy quantifiers (*, +, {n,m}) match as much as possible while still allowing the overall pattern to succeed. Lazy quantifiers (*?, +?, {n,m}?) match as little as possible. For example, <.+> on '<b>text</b>' matches the entire string greedily, while <.+?> matches '<b>' and '</b>' separately.
What is the difference between lookahead and lookbehind?
A lookahead (?=…) asserts that what follows the current position matches the pattern, without consuming characters. A lookbehind (?<=…) asserts that what precedes the current position matches. Their negative counterparts ((?!…) and (?<!…)) assert that the pattern does NOT match at that position.
What is catastrophic backtracking?
Catastrophic backtracking occurs when a regex engine tries an exponential number of ways to match a string before failing. It typically happens with nested quantifiers like (a+)+ on a non-matching input. The engine backtracks through every combination, causing severe CPU usage. Avoid overlapping quantifiers and use atomic groups or possessive quantifiers where supported.

Related Tools

Diff Checker
Compare text and find changes line by line.
URL Encoder/Decoder
Encode and decode URL components.
HTML Entity Encoder
Encode and decode HTML special characters.

Master Regular Expressions Today

Test patterns live, understand every match, and write regex you can actually maintain.

Get started free

Free · No credit card · 50 credits/day