Regex Tester

Test JavaScript regular expressions live, with highlighted matches and capture groups.

Runs in your browser. Your text and files never leave your device.

    Quick regex reference

    \d \w \sdigit, word character, whitespace
    . any character except a line break
    * + ? {2,4}0 or more, 1 or more, optional, 2 to 4 times
    ^ $start and end of text (or line with m)
    [abc] [^abc]one of a, b, c; anything except a, b, c
    (…) (?<name>…)capture group, named group
    a|ba or b
    (?=…) (?!…)followed by, not followed by

    Frequently Asked Questions

    Which regex flavour does this use?

    JavaScript (ECMAScript) regular expressions, run by your browser. Most syntax is shared with Python, PHP (PCRE) and Java, but lookbehind support and some escapes differ.

    What do the flags mean?

    g finds all matches instead of the first, i ignores case, m makes ^ and $ match at every line, s lets . match line breaks, and u enables full Unicode, including \p{L} for any letter.

    How do I see capture groups?

    Each match in the list shows its groups: numbered groups like $1 and named groups like (?<year>\d{4}).

    Why does my pattern freeze the page?

    Some patterns, like (a+)+$, take exponential time on certain text (catastrophic backtracking). Simplify nested repeats. The tester stops after 1,000 matches to stay responsive.

    Free tool: JSON FormatterFormat, validate and minify JSON. Errors show the exact line and column.Free tool: Base64 Encode and DecodeEncode text or files to Base64 and decode Base64 back, with full UTF-8 support.Free tool: URL Encode and DecodePercent-encode text for URLs and decode encoded URLs back to readable text.Free tool: UUID GeneratorGenerate random UUID v4 (GUID) values, one or a thousand at a time.