mAIbmAIbTools

Regex Tester

Test a regular expression against sample text with live highlighting and a match count.

//

How to use

  1. Type your pattern between the slashes and add flags (g, i, m).
  2. Enter or paste the text to test.
  3. Matches are highlighted live with a running count.

How the Regex Tester works

Tests a regular expression against sample text with live highlighting, so you can iterate on a pattern without a run-edit-rerun cycle.

Your pattern is compiled with the JavaScript RegExp engine and run against the test string, with matches and capture groups highlighted as you type.

flags: g global · i case-insensitive · m multiline · s dot matches newline

Worked example

The pattern \b\w+@\w+\.\w+\b picks email-shaped substrings out of a paragraph.

Things worth knowing

Frequently asked questions

What flags are supported?

All standard JavaScript flags, including g (global), i (case-insensitive) and m (multiline).

Does it run on a server?

No — matching uses your browser's regex engine, so nothing is sent anywhere.

Why does my pattern match nothing?

Usually unescaped special characters. Literal . + * ? ( ) [ ] { } | ^ $ \ all need a backslash.

What is the difference between greedy and lazy?

Greedy quantifiers take as much as possible; adding ? makes them lazy and take as little as possible. .*? is the usual fix for a match that swallows too much.