Skip to content

Regex Tester

One test case per line: see at a glance which ones match, and why.

Regex Tester

What does it do?

It runs a regular expression against a list of test cases and shows, for each one, whether it matches (green) or not (red), with the matched part highlighted and every capture group, numbered or named, listed underneath. Below, the regex is explained part by part in plain language.

How to use it

  1. Type the pattern without slashes, or paste a literal like /^\d+$/i: the flags are picked up automatically.
  2. Add the flags you need: g global, i ignore case, m multiline, s dot matches newlines, u Unicode.
  3. Write one test case per line, mixing strings that should and should not match.
  4. Press Share to send the pattern and the test cases in a link.

Common flags

FlagEffect
gfind every match, not only the first
iignore upper and lower case
m^ and $ match at every line
s. also matches line breaks
ufull Unicode: emoji and \p{…} classes

Frequently asked questions

›Which regex engine is used?

Your browser's JavaScript engine, so the results are exactly what you will get in JavaScript, TypeScript and Node.js, including named groups, lookbehind and the d, s, u and v flags.

›What happens if my regex freezes?

Tests run in a Web Worker that is stopped after 1.5 seconds. If that happens, the pattern probably has catastrophic backtracking, for example nested quantifiers like (a+)+ or (.*)*.

›Each line or whole text?

Each line treats every line as a separate test case, ideal for checking validation patterns. Whole text runs the regex over all the text at once, ideal with the g and m flags to find matches inside a document.