Regex Tester

Test regular expressions live with highlighted matches, flags and capture groups. Everything runs in your browser — your text never leaves your device.

/ / g

    How to test a regular expression

    1. Type your pattern between the two slashes — for example \d{3}-\d{4}.
    2. Pick the flags you need (g is on by default) and paste your test text below.
    3. Matches are highlighted instantly, with a numbered list showing each match position and its capture groups.

    Understanding the flags

    The four most common JavaScript regex flags are: g (global) finds every match instead of stopping at the first; i (ignore case) treats A and a the same; m (multiline) makes ^ and $ anchor to the start and end of every line, not just the whole string; and s (dot all) lets . also match newline characters. You can combine them freely — the active flags are shown after the closing slash.

    Capture groups

    Anything you wrap in parentheses becomes a capture group. For example, (\w+)@(\w+) matched against an email captures the user part as group 1 and the domain part as group 2. The match list below the highlighted text shows every group's value for each match, which makes it easy to check patterns you plan to use with replace() or extraction code.

    Is it private and safe?

    Yes. Toolyard runs the regular expression inside your browser on your own device using the built-in JavaScript engine. Your pattern and test text are never uploaded anywhere — safe for log files, code snippets and private data.

    Frequently asked questions

    Which regex syntax does this tester use?

    JavaScript (ECMAScript) regular expressions — the same engine used by browsers and Node.js. Most patterns from other languages work the same way.

    What do the g, i, m and s flags mean?

    g finds all matches instead of just the first, i makes matching case-insensitive, m makes ^ and $ match at every line, and s lets the dot match newline characters.

    Is my text uploaded anywhere?

    No. The pattern and test text are processed entirely in your browser. Nothing is uploaded, so it is safe for logs and private data.

    Is it free?

    Yes, completely free with no sign-up and no limits.