Regex Tester

Type a regular expression and a test string and see every match highlighted as you type, along with the capture groups. The tester uses the JavaScript regular expression engine of your browser.

Flags

Matches highlighted

 

    Runs entirely in your browser. Nothing you enter is sent to a server.

    How to use it

    1. Type your expression in the first box, without the slashes.
    2. Choose the flags you need. g finds all matches instead of only the first.
    3. Paste or type the text you want to test.
    4. Read the highlighted preview and the list of matches and groups below it.

    Flags

    • g (global): find all matches, not just the first.
    • i (ignore case): A matches a.
    • m (multiline): ^ and $ match at the start and end of each line.
    • s (dotAll): the dot also matches line breaks.
    • u (unicode): treat the pattern as Unicode, needed for emoji and for \p{...} properties.

    Frequently asked questions

    Which regex flavor does this use?
    JavaScript (ECMAScript). Most syntax is shared with other languages, but some features differ, such as lookbehind support, named group syntax and possessive quantifiers.
    Why does the page freeze with some patterns?
    Patterns with nested repetition, like (a+)+, can take exponential time on some inputs (catastrophic backtracking). Simplify the pattern or reload the page.
    How do I match a literal dot or bracket?
    Escape it with a backslash: \. matches a dot and \[ matches a square bracket.
    Is my text uploaded?
    No. The test runs in your browser.

    More tools