Test, debug, and explain regular expressions with real-time match highlighting.
A free online regex tester, debugger, and expression builder. Paste regular expressions and target strings to inspect matches with alternating color highlights, numbered capture groups, named capture groups, and substring offsets. Toggle all ECMAScript flags including global (g), case-insensitive (i), multiline (m), dotall (s), unicode (u), unicode sets (v), indices (d), and sticky (y). Test string replacements with standard tokens, split text by delimiter, or inspect token-by-token visual breakdown trees. Export ready-to-run code snippets across JavaScript, TypeScript, Python, Go, Java, C#, PHP, Ruby, and Rust. Features built-in ReDoS safeguards and runs 100% client-side for total privacy.
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, regex unicode sets, redos protection regex
Tags: regex, regexp, regular-expression, test, match, replace, pattern, debug
Regex Tester is also known as: Online Regex Tester, Regular Expression Debugger, Regex Pattern Matcher, Regex Replace & Split Tool, JavaScript Regex Tester, Regex Explainer & Builder.
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.
The Regex Tester supports 6 syntax formats and dialects for accurate parsing and processing.
Master the art of reading cryptic regular expressions by breaking patterns down into visual abstract syntax trees, grouping constructs, lookarounds, and quantifiers.
A comprehensive developer guide to CSS selectors, specificity calculation mechanics, the :has() relational selector, forgiving selector lists, and high-performance DOM querying.
A developer security guide to identifying direct, indirect, and multi-turn prompt injection vulnerabilities in LLM applications and agent pipelines.
Understand NFA regular expression engine backtracking, diagnose exponential runtime traps, and fix Regular Expression Denial of Service (ReDoS) vulnerabilities.
camelCase is a compound word writing convention where each constituent word begins with a capital letter without delimiter spaces, standard in JavaScript and modern software.
A regular expression (Regex) is a sequence of characters defining a search pattern for text matching, string replacement, and robust input validation.
Compare per-token rates, prompt caching discounts, and context windows across leading LLMs (GPT-4o, Claude 3.5 Sonnet, Gemini 2.5 Flash, DeepSeek, and more) in our verified catalog.
Chain Regex Tester with other utilities in a multi-step visual workflow.
Clean logs and extract patterns using regex.
Decode a Base64 string and pretty-print the JSON inside it.
Convert CSV data to JSON, then to YAML format.