Dev Tools
  1. All dev tools
  2. Regex tester

Regex tester

Write a regular expression and see every match highlighted as you type, with capture groups, named groups and a find-and-replace preview.

Flags

Matches highlighted

    How to use the regex tester

    1. Type a pattern without the surrounding slashes, and pick the flags.
    2. Paste the text to test. Matches are highlighted and listed with their groups.
    3. Add a replacement such as $1 or $<name> to preview find-and-replace.

    Questions

    Which regex flavour is this?

    JavaScript (ECMAScript), as used in browsers and Node.js. Most syntax matches PCRE and Python, but some features differ, such as possessive quantifiers, which JavaScript does not have.

    What happens if my pattern hangs?

    Patterns like (a+)+$ can take forever on some inputs (catastrophic backtracking). Matching runs in a background worker and is stopped after two seconds, with a message, instead of freezing your browser.

    Is my data sent anywhere?

    No. Everything runs in your browser with JavaScript. What you paste is never sent to a server, and the site's security policy stops the page from connecting to any other website. That matters for tokens, keys and customer data, which people paste into tools like this every day.