PocketPlay
中文

Regex Tester

Test JavaScript regular expressions live: highlighted matches, capture groups, replace preview and a shareable link.

🔒 Runs in your browser — files never leave your deviceFree · No sign-up
/ /
Presets

Test string

Replace

Matches

#MatchIndexGroups

No matches yet.

How to use the regex tester

  1. Type a pattern between the slashes and tick the flags you need (g, i, m, s, u, y).
  2. Paste the text you want to search — every match is highlighted as you type, and the table lists each match with its position and capture groups.
  3. Add a replacement like $1-$2 or $<name> to preview the rewritten text, then copy it or press Share link to send the whole test to a colleague.

FAQ

Which regex flavour is this?

JavaScript (ECMAScript) regular expressions, run by your own browser engine — the same behaviour you get from String.replace and RegExp.exec in Node or the console. PCRE-only syntax such as atomic groups or recursion is not supported.

How do named groups work?

Write (?<year>\d{4}) and the match table shows a year row. In the replacement box refer to it as $<year>; numbered groups stay $1, $2, and $& is the whole match.

Is my test text sent anywhere?

No. The pattern and the text are evaluated in your browser. The Share link packs both into the URL fragment (the part after #), which browsers never send to a server — but treat that link as you would the text itself.