canivete
    es

    TOOL · DEV

    Test regular expressions (regex)

    Type the pattern, paste the text and see matches highlighted instantly — with captured groups, a counter and a cheat sheet of 10 common patterns for when memory fails.

    flags

    Type a pattern to get started.

    Quick reference: 10 common patterns
    • \done digit (0–9)
    • \wletter, digit or _
    • \sspace, tab or newline
    • .any character (except newline)
    • ^ and $start and end of text (or of line, with the m flag)
    • [abc]one character from the set: a, b or c
    • a+ a* a?one or more · zero or more · optional
    • a{2,4}2 to 4 repetitions of a
    • (ab|cd)captured group: ab or cd
    • (?<name>…)named capture group

    Everything runs in your browser, on JavaScript’s own regex engine — nothing is sent.

    Processed in your browser — your files never leave your computer.

    How it works

    1. Type the pattern

      Without the slashes — just the body, e.g. \d{2}/\d{2}/\d{4}. Check the flags you need: g (all occurrences), i (case insensitive), m, s and u.

    2. Paste the test text

      Matches get highlighted in green as you type, with a counter — up to 1,000 occurrences. An invalid regex shows the engine error right away.

    3. Check the groups

      Each match lists its captured groups — numbered ($1, $2…) and named. Stuck? Open the "Quick reference" with 10 common patterns explained.

    Frequently asked questions

    Which regex flavor is used here?

    JavaScript — the same engine as your browser. The syntax is nearly identical to Python, PHP and Java for everyday use (\d, \w, groups, quantifiers); differences show up in advanced features like lookbehind on older engines.

    What are the g, i, m, s and u flags for?

    g finds all occurrences (without it, only the first); i ignores upper/lower case; m makes ^ and $ work per line; s lets the dot match newlines; u turns on unicode mode, so emoji and accents count as a single character.

    My regex matches nothing — what do I check first?

    The three usual suspects: an unescaped special character (dot, parenthesis, slash — use \. \( \/), the i flag off while the text has capitals, and an invisible space in the pattern. The quick reference at the bottom helps you build the right pattern.

    What are captured groups?

    Anything you wrap in parentheses in the pattern becomes a group: the part of the match it grabbed is listed as $1, $2… Named groups, written (?<name>…), show up by name. Handy for extracting just a piece, like the day in a date.

    Why did it stop at 1000 matches?

    That is the display limit, so the page never freezes with patterns that match too much (like \w on huge text). The counter warns when the text has more matches than that — refine the pattern to see fewer, better results.

    Is the text I paste sent to any server?

    No. The test runs on your browser’s own regex engine, on your machine. Production logs, customer data — nothing leaves it.

    Other tools