Regex Explainer — What Does This Regular Expression Do?

Paste any regular expression and see what every part means — in plain English, token by token: character classes, groups and named groups, quantifiers (greedy and lazy), anchors, alternation, lookahead and lookbehind, backreferences and flags.

Runs in your browserUpdated
//
Examples:

Explanation

    Want to try it on text? Open it in the Regex Tester.

    Your data never leaves your computer. All processing happens 100% locally in your browser.

    How to use the Regex Explainer

    1. Paste a regular expression between the slashes (with or without the surrounding /…/) and add flags like gi.
    2. The explanation lists every part in order, with nested groups indented.
    3. Click an example to see common patterns explained.
    4. Test it on real text with Regex Tester.

    Reading a regular expression

    TokenMeaning
    .any character except a line break
    \d \w \sa digit, a word character (letter, digit, underscore), whitespace; uppercase means “not”
    [abc] [^abc] [a-z]one of these, none of these, a range
    * + ? {2,5}0 or more, 1 or more, optional, between 2 and 5 times; add ? to make it lazy
    ^ $ \bstart, end, word boundary
    ( ) (?: ) (?<name> )capturing, non-capturing and named groups
    (?= ) (?! ) (?<= ) (?<! )lookahead, negative lookahead, lookbehind, negative lookbehind
    a|ba or b

    The explainer follows JavaScript regex syntax, which is also very close to PCRE (PHP), Python, Java and .NET for everyday patterns.

    Related: Regex Tester, Find and Replace, AI prompts for developers.

    Also searched as: explain regex, regular expression explained, what does this regex do, regex to english, regex breakdown, regex meaning, understand regex, regex parser.

    Tools that pair well with the Regex Explainer

    • Text Compare — Paste two versions of a text to see exactly what changed: added and removed lines and the changed words inside them, highlighted side by side or in one view.
    • Remove Duplicate Lines — Paste a list to remove duplicate lines instantly.
    • Case Converter — Paste any text and convert it between 11 letter cases — from Title Case for headlines to camelCase and snake_case for code.
    • JSON Path Finder — Paste a webhook payload or API response, click any value and copy its exact path — for JavaScript, JSONPath, jq, Python, PHP, n8n and Make.

    Frequently asked questions

    How do I understand a regular expression?
    Paste it here: each token is explained in plain English in order, with groups nested, so you can read the pattern step by step.
    What does (?: … ) mean in regex?
    A non-capturing group: it groups tokens (for example to apply a quantifier) without saving the match as a numbered group.
    What is the difference between greedy and lazy?
    Greedy quantifiers (*, +, {n,}) match as much as possible; adding ? (*?, +?) makes them lazy, matching as little as possible.
    Which regex flavor is used?
    JavaScript (ECMAScript), including named groups, lookbehind and the u, s, y and d flags. Most of it applies to PCRE, Python and Java too.
    Can I install Regex Explainer as a web app and use it offline?
    Yes. Regex Explainer is an installable web app (PWA) — installed from your browser, not downloaded from an app store. Click Install app at the top of this page in Chrome or Edge (Windows, macOS, Linux, ChromeOS) or on Android, use Share → Add to Home Screen on iPhone and iPad, or File → Add to Dock in Safari 17+ on a Mac. It then opens in its own window with its own icon, and because it runs entirely in your browser it keeps working offline. Firefox on desktop can’t install web apps. How installing works.

    Related tools