Esta página ainda não foi traduzida para o português, por isso aparece em inglês.

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.

Atualizado em
//
Examples:

Explanation

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

    Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

    Como usar: 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.

    Também pesquisado como: explain regex, regular expression explained, what does this regex do, regex to english, regex breakdown, regex meaning, understand regex, regex parser.

    Ferramentas que combinam com: 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.
    • Conversor de maiúsculas e minúsculas — Cole qualquer texto e converta-o entre 11 estilos de letras — desde “Title Case” para títulos até “camelCase” e “snake_case” para código.
    • 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.

    Perguntas frequentes

    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.
    Posso instalar o Regex Explainer como um aplicativo da web e usá-lo offline?
    Sim. O Regex Explainer é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

    Ferramentas relacionadas