Regex Tester

Test your regular expressions in real time and see matches highlighted.

How it works

  1. 1

    Write your pattern between the slashes and enable or disable the flags (g, i, m, s) as needed.

  2. 2

    Paste the test text below: matches highlight instantly and are listed with their captured groups.

  3. 3

    Tweak the pattern live until the highlighting marks exactly what you want.

How does it work?

Write your regular expression and test it against any text: matches are highlighted in real time together with captured groups.

It uses the same JavaScript engine as your browser, so what you see here behaves exactly like in your code. Toggle the g, i, m or s flags as you need.

Use cases

Validate formats

Check if emails, dates or phone numbers match the pattern you expect before applying it in code.

Debug captures

Review what capture groups () return in each match to build your replacement or extraction correctly.

Learn regex

Experiment with classes, quantifiers and anchors and see the visual result on every attempt.

Frequently asked questions

Does it implement the JavaScript (ECMAScript) engine?

Yes, expressions are evaluated with the browser native syntax, the same as Node.js. What you test here behaves the same in your code.

What are the flags for?

g (all matches), i (ignore case), m (^ and $ act per line) and s (the dot also matches newlines).

When would I use a capture group?

When you want to extract part of a match: for example, in (\d{2})-(\d{2})-(\d{4}) each parenthesis returns a piece of data you can reuse.

Related tools