Home โ€บ Developer Tools โ€บ Regex Tester

๐Ÿงช Regex Tester

Test regular expressions live: match count, matched text and highlighted results.

About this Regex Tester

Regular expressions are the power tool of text searching โ€” one pattern can find emails, dates, codes or any shape of text. This tester runs your pattern against sample text with JavaScript regex rules, counts and lists every match with its position and capture groups, and highlights matches in place so you can see exactly what your pattern catches before using it in code.

How to use it

  1. Write your pattern in the top box (no slashes needed).
  2. Set flags such as g (global), i (ignore case) or m (multiline).
  3. Paste sample text and click Test regex.
  4. Check the match list and highlighting; adjust the pattern until it matches exactly what you intend.

Example

The pattern \d{4} against 'Order 2024 shipped in 2025, code 99' finds 2 matches โ€” 2024 and 2025 โ€” and ignores the short 99.

Frequently asked questions

Which regex flavour is this?

JavaScript (ECMAScript) regular expressions โ€” the same rules used in browsers and Node.js. A few features differ from PCRE or Python.

Why did my pattern stop at one match?

Add the g flag for global matching. Without it, only the first match is ever found โ€” this tester adds g automatically for the match loop.

More Developer Tools