Regex Tester

रेगेक्स टेस्टर

Test JavaScript regular expressions with live highlighting, groups and replace. How to use ↓

  • 100% free
  • No sign-up
  • Private – runs in your browser
  • Works on mobile
//

How to use the Regex Tester

How to use Regex Tester: 1. Enter a pattern (without the surrounding slashes). 2. Tick flags such as g (global) or i (ignore case). 3. Type test text – matches highlight instantly. 4. Optionally enter a replacement using $1, $2 for groups.
Read the steps as text
  1. Enter a pattern (without the surrounding slashes).
  2. Tick flags such as g (global) or i (ignore case).
  3. Type test text – matches highlight instantly.
  4. Optionally enter a replacement using $1, $2 for groups.

Supported formats: Text

JavaScript flavour

Patterns run with your browser's JavaScript engine, so results match what your JS code will do. Named groups (?<name>…), lookbehind and the u and s flags are supported in modern browsers.

Safe testing

Some patterns, like (a+)+$, can take exponentially long on certain inputs (catastrophic backtracking). Here every test runs in a separate worker that is stopped after 1.5 seconds, so a bad pattern cannot freeze your browser – and you learn that the pattern needs fixing.

Frequently asked questions

Is this PCRE (PHP) or JavaScript regex?

JavaScript. Most syntax is the same, but some PCRE features (possessive quantifiers, recursion) are not available.

Why does my pattern “time out”?

It causes catastrophic backtracking. Avoid nested quantifiers such as (a+)+ or (.).