Skip to content
Jellykit

Regex Tester

Test a regular expression against sample text and see every match and capture group highlighted, with runaway patterns stopped safely.

  • Runs on your device
  • Works in the background
Loading tool

About Regex Tester

Write a regular expression, paste some text, and see every match highlighted in place along with its position and capture groups. Flags are simple switches, and the pattern is checked as you type so syntax mistakes are explained immediately.

Patterns run in a background thread with a time limit. An expression that backtracks out of control is stopped and reported instead of freezing the page.

How it works

  1. The pattern is compiled with the JavaScript (ECMAScript) regular expression engine built into your browser.
  2. Matching runs in a Web Worker. If it has not finished within three seconds it is terminated, which protects against catastrophic backtracking.
  3. Each match is listed with its character position and the contents of its numbered and named groups, and highlighted in the original text.

Questions

Which regex flavour is this?

JavaScript. Most syntax carries over to other engines, but features such as possessive quantifiers, inline flags like (?i), and some lookbehind forms differ between languages.

Why does my pattern only find one match?

Without the global flag a JavaScript regex stops after the first match. Turn on Global to find them all.

What does "took too long" mean?

The engine was still searching after three seconds, usually because nested quantifiers such as (a+)+ force it to try an enormous number of combinations. Rewrite the pattern so each character can only be matched one way.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.