Regex Tester

Test any regular expression live — matches, positions and Replace mode.

FREE TOOL · WORKS OFFLINE · NO SIGN-UP
—
—

    Matches update as you type. Without the g flag only the first match is shown or replaced.

    🧪 How to Use This Regex Tester

    1. 1.Type a pattern. Start with \d+ on the sample text — it finds 123 and 45 right away.
    2. 2.Toggle flags. g finds every match, i ignores case, m makes ^ and $ work per line, s lets . match newlines, u enables full Unicode mode.
    3. 3.Read the positions. Every match lists its index in the text, so you can see exactly where each hit starts.
    4. 4.Switch to Replace mode. Swap every match for your replacement — $1 and $2 insert capture groups, $& inserts the whole match.
    5. 5.Broken patterns are safe. A bad pattern like ( shows its error message in red and never crashes the page — fix it and results return.

    ❓ FAQ

    What is a regular expression?

    A regular expression is a compact pattern for describing text: \d matches a digit, \w matches a word character, ^ anchors to the start and $ to the end. For example, \d+ on abc123def45 finds 123 and 45, and ^\w+@\w+\.\w+$ matches a simple email like test@example.com.

    Why does my pattern show an error?

    An invalid pattern, such as a lone opening bracket (, cannot be compiled, so the tester shows the browser's error message instead of results. Fix the syntax and the matches return instantly — an invalid pattern never crashes the page.

    How does Replace mode work?

    Switch to Replace mode, type a replacement, and every match is swapped for it. The replacement supports $1, $2 for capture groups and $& for the whole match. Without the g flag only the first match is replaced.

    Is this regex tester free?

    Yes — 100% free, no sign-up. Test as many patterns as you like; everything runs in your browser and nothing is uploaded.

    More free tools →