Regex Tester

Regex Tester

Test a regular expression against your text and see every match highlighted, with capture groups listed.

Highlighted text

Matches

    Enter the pattern without surrounding slashes — the flags are set with the checkboxes above. This uses your browser’s JavaScript regular expression engine.

    About the Regex Tester

    Lets you test a regular expression (regex) against sample text and see every match highlighted in real time, so you can debug patterns before using them in code.

    How to use

    1. Type your regex pattern (without surrounding slashes) and pick flags such as g (global), i (ignore case), and m (multiline).
    2. Paste your test text into the test-string box.
    3. Inspect the highlighted matches, capture groups, and optional find-and-replace result.

    Key features

    • Live match highlighting that updates as you type, with match positions and numbered/named capture groups shown.
    • Replacement preview using backreferences like $1 or $<name> shows exactly how the pattern rewrites text.
    • Uses the JavaScript (ECMAScript) regex engine in your browser, so what matches here matches in your JavaScript code.

    Frequently asked questions

    What is a regular expression?

    A pattern used to match, search, extract, or replace strings of text — for example, validating an email format.

    Is my test data private?

    Yes — matching happens locally in your browser and your text never leaves your device.

    Free to use, no signup needed. This tool runs entirely in your browser — your data never leaves your device.