Regex Tester

Test a regular expression against sample text and see every match highlighted live. Matching runs entirely in your browser.

Flags

    How to test a regular expression

    1. Type or paste your pattern into the Pattern field. Matches highlight in the test text as you type.
    2. Toggle the flags you need: g for every match, i to ignore case, m for multiline anchors, s to let a dot match newlines, u for unicode, and y for sticky matching.
    3. Paste the text you want to search into the test area. Each match is listed with its start index and every capture group.
    4. Reuse an earlier pattern from Recent patterns, which keeps the valid patterns you have tried along with their flags.

    When to use it

    Writing a regex by trial and error inside code means editing, re-running, and reading output every time. Here the highlight updates the moment you change the pattern, so you can see exactly what it matches and, just as important, what it misses before you paste it back into your code.

    The per-match breakdown of capture groups is useful when the pattern isn’t just for validation but for pulling fields out of a string. Line up your groups against real sample text, confirm each one captures what you expect, then lift the finished pattern into your language of choice.

    Frequently asked questions

    Is my text uploaded?

    No. Matching runs in your browser with the native RegExp engine. Your test text is never sent anywhere or saved.

    Which flags are supported?

    g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode), and y (sticky), each toggleable.

    Does it show capture groups?

    Yes. Each match is listed with its start index and every capture group, and matches are highlighted in the text.

    Are my patterns remembered?

    Your recent valid patterns (with their flags) are kept in your browser so you can reuse them; the test text is never stored.