RegEx Tester & Debugger

Write a pattern, see every match highlighted live — with capture groups, replace preview and a plain-English explanation. All in your browser.

Matches highlighted

Pattern explained

    How to test a regular expression online

    Type a pattern in the box (without surrounding slashes — the tool adds them visually) and your test text below it. Matches highlight live on every keystroke, the table lists each match with its position and capture groups, and the explainer breaks the pattern into plain English piece by piece. Toggle flags with the checkboxes: g for all matches, i for case-insensitive, m for line-by-line anchors, s for dot-matches-newline, u for Unicode, y for sticky matching.

    This tester uses the JavaScript (ECMAScript) regex flavor — the exact engine browsers and Node.js run, so what works here works in your frontend and Node code unmodified. Add a replacement string to preview String.replace() output including $1/$<name> references. Everything is evaluated locally by your browser; your text is never uploaded.

    Beware catastrophic backtracking: nested quantifiers such as (a+)+b can freeze any regex engine on non-matching input. Keep quantifiers specific, avoid nesting them, and test edge cases here first. Cleaning data afterwards? Try the Text Diff Checker or JSON Formatter.

    Frequently Asked Questions

    Which regex flavor is this?
    JavaScript (ECMAScript) — identical to browsers and Node.js. Most patterns port to Python/PCRE, but JS lacks possessive quantifiers and atomic groups.
    What do the flags mean?
    g = all matches, i = ignore case, m = ^ and $ match every line, s = dot matches newlines, u = full Unicode, y = each match must start where the last ended.
    What is a capture group?
    Parentheses capture matched text into numbered groups ($1, $2) or named ones like (?<year>\d{4}). Use (?:...) to group without capturing.
    Why does my regex freeze?
    Catastrophic backtracking from nested/ambiguous quantifiers like (a+)+. Make patterns more specific; this page caps input size to stay responsive.
    Is my text uploaded?
    No — evaluation happens in your browser's own RegExp engine. No server, no logging.