Tools

Regex tester

Test a JavaScript regular expression in your browser. See match index and groups. Nothing is uploaded.

Enter a pattern, then Test. Matches stay in this tab.

How to use the Regex tester

  1. Enter the pattern without surrounding slashes.
  2. Set flags (g, i, m, s) and paste the test string.
  3. Click Test. Matches list index, text, and capture groups.

JavaScript regex

The engine is the browser's RegExp, not PCRE or Python. Lookbehind and Unicode property escapes depend on the browser. A global flag walks all matches; empty matches advance one character so the loop cannot spin forever. Results cap at 5,000 matches.

Nothing is uploaded

The pattern and the string stay in the tab. 1.5 MB test string.

Regex tester FAQ

Do I include /pattern/g?

No. Put the pattern in the box and tick g separately.

Catastrophic backtracking?

A greedy pattern on a long string can still freeze the tab. Keep tests small.

Replace?

This page lists matches. It does not rewrite the string.

Related tools