Text Diff Checker
Compare two texts or code snippets side by side, with changed words highlighted and a downloadable patch.
Test regular expressions with live match highlighting, capture groups, and replace. Free, private, and 100% in your browser.
Enter a pattern to start.
Matches and capture groups will appear here.
A regular expression (regex) is a pattern that describes text: email addresses, dates, log lines, or anything else with a structure. This regex tester runs your pattern against sample text instantly and highlights every match, so you can build and debug expressions before you use them in JavaScript, TypeScript, Node.js, or most other languages.
Every match is highlighted in the test string as you type the pattern or the text.
See each match with its index and the value of every numbered and named group.
Preview replacements with $1, $<name>, and $& references, then copy the result.
Toggle g, i, m, s, u, and y, with a short explanation of each.
Patterns run in a background worker with a time limit, so catastrophic backtracking cannot hang the page.
Your pattern and test data never leave your browser.
.\d \D\w \W\s \S[abc] [^abc][a-z]\p{L}^ $\b \B* + ?{3} {3,} {3,5}*? +?(abc)(?<name>abc)(?:abc)\1 \k<name>a|b(?=abc) (?!abc)(?<=abc) (?<!abc)It uses your browser's JavaScript (ECMAScript) regular expression engine, the same one used by Node.js, TypeScript, and front-end code. Most syntax is shared with PCRE, Python, Java, and .NET, but features like possessive quantifiers and recursion are not available in JavaScript.
Without the g (global) flag, a JavaScript regex stops at the first match. Enable g to find all matches.
The pattern caused catastrophic backtracking: the engine tried an exponential number of ways to match. This usually comes from nested quantifiers such as (a+)+ or (.*)*. Make the pattern more specific, for example by replacing .* with a negated character class like [^,]*.
Switch to Replace mode. Use $1, $2, … for numbered groups, $<name> for named groups, $& for the whole match, and $$ for a literal dollar sign.
No. Matching and replacing happen entirely in your browser.
Compare two texts or code snippets side by side, with changed words highlighted and a downloadable patch.
Convert text and variable names to camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, and more.
Count words, characters, sentences, lines, and UTF-8 bytes as you type, with reading time and length limits.
Beautify, minify, and validate JSON instantly with exact line and column error reporting.