Test, debug, and explain regular expressions with real-time match highlighting.
Free online regex tester and debugger. Paste a regular expression and test string to see all matches highlighted in real-time with capture group details. Toggle flags (g, i, m, s, u, v, d, y), test replacements with $1/$& tokens, split strings by pattern, or get a full visual breakdown of your regex structure. Generate ready-to-use code snippets in JavaScript, TypeScript, Python, Go, Java, C#, PHP, Ruby, and Rust. Includes a built-in regex cheat sheet and 30+ common pattern templates. Runs entirely in your browser — no data is ever sent to a server.
Keywords: regex tester, regex tester online, regex101, regular expression tester, regex match, regex replace, regex debugger, regex explainer, regex generator, test regex online, regex validator, regex builder, regex cheat sheet, regex capture group, regex lookahead, regex named group, javascript regex, python regex, regex pattern matcher, regex online tool, regex playground, regex flags, regex split, regular expression online
Tags: regex, regexp, regular-expression, test, match, replace, pattern, debug
Enter your regular expression in the pattern field at the top of the left panel. The regex is validated in real-time — errors are shown immediately with clear messages.
Toggle regex flags using the flag buttons below the pattern: g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode), v (unicode sets), d (indices), y (sticky).
Paste or type your test string in the text area below the flags. Matches are highlighted instantly with alternating colors.
View match results in the right panel: each match shows the full text, index, length, numbered capture groups, and named capture groups.
Switch between modes using the bottom bar: Test (match highlighting), Replace (substitution preview), Split (string splitting), Explain (regex breakdown tree), or Generate (code snippets in 9 languages).
Use the Cheat Sheet button for an inline regex syntax reference, or browse the Common Patterns library for 30+ battle-tested regex templates.
Copy results with ⌘⇧C, or share your regex and test string via a compressed URL.
Real-time match highlighting: all matches highlighted with alternating colors directly in the test string as you type.
Full capture group support: view numbered groups ($1, $2, ...) and named groups (?<name>...) for every match.
8 regex flags: toggle g, i, m, s, u, v, d, y with instant visual feedback and tooltip descriptions.
Replace mode: test string.replace() and string.replaceAll() with substitution tokens ($1, $&, $', $`, $<name>).
Split mode: test string.split(regex) and view the resulting array with element count.
Regex explainer: visual tree breakdown of your regex structure — groups, quantifiers, anchors, lookarounds, and character classes explained in plain English.
Code generation: generate ready-to-use regex code in JavaScript, TypeScript, Python, Go, Java, C#, PHP, Ruby, and Rust.
Match statistics: total matches, unique matches, average match length, coverage percentage, shortest and longest match.
Inline regex cheat sheet: searchable reference for all regex syntax — character classes, quantifiers, anchors, groups, lookarounds, Unicode properties, and escapes.
Common patterns library: 30+ categorized, battle-tested regex templates for emails, URLs, IPs, dates, passwords, HTML tags, and more.
Pattern validation: real-time syntax checking with clear error messages for invalid regex.
Catastrophic backtracking protection: patterns that would cause excessive execution time are safely terminated.
Shareable URLs: gzip-compresses your pattern, flags, and test string into a URL for team sharing.
Works entirely in your browser — no regex patterns or test data are ever sent to any server. Your data stays completely private.
Keyboard shortcuts for power users: ⌘↵ to run, ⌘⇧R for replace, ⌘⇧E for explain, ⌘⇧G for generate, ⌘⇧H for cheat sheet.