Regex tester online

Online regex tester: type a regular expression and flags, paste your text and see matches and capture groups live. JavaScript engine, free, no account.

Flags
  • To paste into JavaScript /(\d{2})-(\d{3})/g

In the text

Matches

    How to use it in three steps

    Step by step, with this page's example.

    1. 01

      Enter the pattern and flags.

    2. 02

      Paste the text to test.

    3. 03

      See matches and groups live.

    What you enter

    Pattern (\d{2})-(\d{3}) on the text "Codes: 00-950 Alpha, 30-001 Beta, 80-827 Gamma"

    What you get
    00-950 (group 1: 00, group 2: 950)
    30-001 (group 1: 30, group 2: 001)
    80-827 (group 1: 80, group 2: 827)

    Questions

    What is a regular expression?
    A regular expression (regex) is a pattern that describes pieces of text, for example (\d{2})-(\d{3}) matches the postal code 00-950. This tester highlights the matches, capture groups and flags as you type, using your browser's JavaScript engine, and sends nothing anywhere.
    How do I test a regex online?
    Enter the pattern and flags, paste the text to test and watch the matches and groups update live. Everything is calculated in your browser.
    How do I write a regex for a postal code?
    The pattern \d{2}-\d{3} matches a Polish postal code such as 00-950. Paste it into the pattern field; brackets around the digits, as in (\d{2})-(\d{3}), show each part in its own group.
    Which regex engine does it use?
    The browser's JavaScript engine. Its syntax is close to PCRE, but not everything from other languages behaves the same.
    What is the g flag for?
    It finds every match instead of stopping at the first.

    Tell us what you want to build.

    A free quote comes back within an hour during working hours. You talk to the person who writes the code.