Skip to content
HandfulTools

Regex Tester

Write a regular expression and see every match highlighted in your test text as you type, with capture groups listed in a table and an optional find-and-replace preview.

Runs in your browser

Loading…

How to use

  1. Enter your regular expression (without slashes).
  2. Toggle flags such as global or case-insensitive.
  3. Paste the test text and check the highlighted matches.
  4. Optionally enter a replacement to preview the result.

How it works

The tool uses your browser's JavaScript (ECMAScript) regex engine, so behaviour matches code running in Node.js and browsers. Named groups, lookbehind and Unicode property escapes such as \p{L} are supported with the u flag.

To protect your browser, matching stops after 1,000 matches or half a second, which prevents freezes caused by catastrophic backtracking.

Examples

Emails
\b(\w+)@(\w+\.\w+)\b captures user and domain separately, e.g. $1 = ada, $2 = example.com.

Common uses

  • Building validation patterns
  • Writing search-and-replace rules
  • Learning and debugging regex

Privacy & security

This tool runs entirely in your browser. Your files and text are never uploaded to our servers — processing happens on your device and results are created locally. How each tool handles files

Frequently asked questions

Is this the same as PCRE or Python regex?

Mostly, but not entirely. Some features differ (e.g. possessive quantifiers). Test in your target language for edge cases.

Why doesn't \d match Arabic digits?

In JavaScript \d only matches 0–9. Use \p{Nd} with the u flag to match digits in all scripts.

Last updated: