Test a regular expression against your own text and see every match highlighted as you type. Check the capture groups, preview a find and replace, and read what each part of the pattern does in plain English. It uses JavaScript regex syntax and runs in your browser.
Free online regex tester for JavaScript regular expressions. Live match highlighting, a capture groups table, a find and replace preview and a plain-English explanation of every part of the pattern. Runaway patterns are stopped after 1.5 seconds. Runs in the browser.
Matches show up here
Type a pattern above or pick an example.
A plain-English reading of your regex
Each piece of the pattern gets a line: character sets, quantifiers, groups, anchors and lookarounds.
Was this tool helpful?
This is the Date example from the tester, a pattern for ISO dates like 2026-09-26 with a named group for each part. The explanation below is what the tool prints for it.
/(?<year>\d{4})-(?<month>0[1-9]|1[0-2])-(?<day>0[1-9]|[12]\d|3[01])/g(?<year>…)Capture group 1, named “year”\d{4}A digit (0 to 9), exactly 4 times-The character “-”(?<month>…)Capture group 2, named “month”0The character “0”[1-9]One character: 1 to 9|Or1The character “1”[0-2]One character: 0 to 2-The character “-”(?<day>…)Capture group 3, named “day”0The character “0”[1-9]One character: 1 to 9|Or[12]One character: “1” or “2”\dA digit (0 to 9)|Or3The character “3”[01]One character: “0” or “1”The pieces most patterns are built from, in JavaScript syntax. Paste any of them into the tester to see them explained in context.
Email, URL, date, phone, IPv4 and hex color are one click away. Toggle g, i, m, s, u and y as needed.
Matches are highlighted as you type. Drop a .txt or .log file if the text is long.
The Groups tab shows each capture, Replace previews the result, and the explanation shows what every token does.
Type the pattern between the slashes, switch on the flags you need and paste your text below it. Every match is highlighted as you type, the Groups tab lists what each capture group caught, and Replace shows the text after a find and replace. Matching runs in your browser, so the text is never uploaded.
Yes. Under the results, each part of the pattern gets its own line in plain English, such as \d{4} as "a digit, exactly 4 times" or (?<year>…) as "capture group 1, named year". Groups and alternatives are indented, so you can read a long pattern from an AI assistant or an old codebase before you trust it.
It uses your browser's JavaScript RegExp engine, with the same syntax Node.js, Deno and web apps use. That covers lookahead, lookbehind, named groups, Unicode property escapes like \p{L} and the g, i, m, s, u and y flags. Patterns written for PCRE, Python or Java mostly work, but possessive quantifiers and atomic groups don't.
g finds every match instead of stopping at the first. i ignores case. m makes ^ and $ match at the start and end of each line. s lets the dot match line breaks. u reads the pattern as full Unicode, which \p{…} needs. y (sticky) only matches at the exact spot where the last match ended.
Parentheses capture the text they match, numbered from left to right as $1, $2 and so on. (?<name>…) gives a group a name you can use as $<name>. (?:…) groups without capturing. The Groups tab shows one row per match with a column for each group, and you can copy it or download it as a TSV file.
Open the Replace tab and type the replacement. Use $1 or $<name> to insert a captured group, $& for the whole match and $$ for a literal dollar sign. With the g flag every match is replaced, without it only the first. Pick the Date example to see 2026-09-26 turned into 26/09/2026.
Nested quantifiers such as (a+)+ or (.*)* can make the engine try an exponential number of paths when a match fails, which is called catastrophic backtracking. This tester runs the pattern in a background worker and stops it after 1.5 seconds, so the page stays usable. Make the inner part more specific to fix it.
The usual causes are a missing g flag (only one match is found), an unescaped dot or bracket, ^ and $ without the m flag on multi-line text, or case differences without the i flag. Read the plain-English explanation line by line. The first step that doesn't describe your text is where the pattern goes wrong.
Test it here before it ships. If you write a lot of patterns and parsers with AI help, pick the model that's best at code.
Everything from model picks to CSV converters, with no account needed.