Skip to content
TPTechPixelly
Developer Tools

Regex Tester

Test a regular expression against text and see every match live.

Loading tool…

About this regex tester

Regular expressions are famously easy to get almost right. The gap between almost and exactly is where the bugs live, and the fastest way to close it is to watch the matches update as you type.

This tester highlights every match in your sample text, lists the capture groups for each one, and includes a replace mode so you can check a substitution before running it on real data.

How to use it

  1. Type your pattern and pick the flags you want.
  2. Paste some sample text underneath.
  3. Matches highlight instantly, with capture groups listed below.
  4. Switch to the replace tab to test a substitution.

Regex Tester — FAQ

Which regex flavour is this?

JavaScript's, which is what runs in your browser. It is close to PCRE but not identical — lookbehind is supported in modern browsers, and named groups use the (?<name>...) syntax.

What does the g flag do?

Global: find every match rather than stopping at the first. Without it you only ever get one result.

Why is my pattern hanging?

Almost certainly catastrophic backtracking — nested quantifiers like (a+)+ against a long non-matching string. Simplify the nesting or anchor the pattern.

Is my text sent anywhere?

No. The pattern runs in your browser against text that never leaves your device.

More free tools

See all tools or take a break with a game.