Skip to content

Regex Tester

Test a regular expression against sample text with live highlighting and capture groups.

regex.exe

Regex Tester

Test a regular expression against sample text with live highlighting and capture groups.

Starts in your browser. Instructions are below.

How to use Regex Tester

  1. 01Enter your pattern in the Pattern field and your flags in the Flags field, such as i to ignore case or m for multiline.
  2. 02Paste the text you want to test against in the test string box.
  3. 03Matches are highlighted as you type, with each match's index and capture groups listed below.

About Regex Tester

This regex tester runs the JavaScript regular expression engine, so what you see here is exactly what your code will do in a browser or in Node. Flags, lazy quantifiers, lookahead, and capture groups all behave the same way.

Type a pattern and flags, paste a test string, and matches highlight live in the text while a list below shows each match's position and any captured groups. Invalid patterns show the exact JavaScript error instead of silently failing.

Use it to build or debug a pattern before dropping it into code, for example matching email addresses with a pattern like (\w+)@(\w+\.\w+) and checking the capture groups split the username from the domain correctly.

Frequently asked questions

Which regex dialect does this test?
JavaScript's, so results match what your front-end or Node code will produce.
Why does my pattern only find one match?
Add the g flag in the Flags field. The tester applies it automatically for highlighting, but add it yourself if you copy the pattern into code.
Are capture groups shown?
Yes, every match lists its index and each numbered capture group underneath.
What happens if my pattern is invalid?
The tester shows the JavaScript engine's own error message instead of a match list.

No spam. Unsubscribe anytime.

Related tools and tools