Developer Runs in your browser Free New

Regex Tester — Live Matches, Plain-English Explanation

Test JavaScript regular expressions with live highlighting, capture groups, a replace preview and a line-by-line explanation of what your pattern does. Copy ready-made code for JavaScript, Python, PHP or Java. A runaway pattern is stopped after 1.5 seconds instead of freezing your tab.

Test a regex
//g

What it means

    Matches & groups

    Use it in code

    
        

    Why this regex tester is different

    Regex cheat sheet

    Frequently asked questions

    Which regex flavor does this use?

    Your browser's JavaScript engine (ECMAScript 2024), including named groups, lookbehind and Unicode properties. Most patterns work the same in Python, PHP (PCRE) and Java; the code export converts the syntax that differs.

    Why does my pattern only find one match?

    Without the g (global) flag JavaScript stops after the first match. Turn on g to see them all.

    What is catastrophic backtracking?

    Patterns like (a+)+$ can take exponential time on text that almost matches. Real servers have gone down because of it. Here the test is stopped after 1.5 seconds and you're told why — rewrite the nested quantifier to fix it.