Regex Tester

Write a regular expression, choose flags, and see every match highlighted with its position and capture groups — instantly, as you type. Invalid patterns get a clear error instead of a crash, and runaway matches are capped to keep the page responsive. Everything runs in your browser.

Privacy: this tool processes your data entirely in your browser. Nothing you paste or type is sent to the server.

The regular expression, without surrounding slashes.

g global · i case-insensitive · m multiline · s dotall · u unicode · y sticky.

The text to search for matches.

Result

Enter your values and press Calculate — the result appears here.

Worked examples

Email addresses

  • pattern = \b[a-z]+@[a-z]+\.[a-z]{2,}\b
  • flags = gi
  • text = Contact alice@example.com or bob@example.org.

Result: 2 matches: alice@example.com (index 8) · bob@example.org (index 31)

Capture groups

  • pattern = (\d{4})-(\d{2})-(\d{2})
  • flags =
  • text = Date: 2023-11-14

Result: 1 match: 2023-11-14 with groups [2023, 11, 14]

Invalid pattern

  • pattern = (unclosed
  • flags =
  • text = x

Result: Invalid pattern: missing closing parenthesis

Frequently asked questions

Which regex flavor is used?

JavaScript (ECMAScript) regular expressions — the same engine as your browser. If you are porting from PCRE or Python, some syntax such as lookbehind may behave slightly differently.

Why does the match count stay small on huge inputs?

To keep the page responsive, the tester reports the first 500 matches and notes when it stopped. The pattern itself is still evaluated by the browser.

Are my patterns and text sent anywhere?

No. Everything runs locally in your browser — safe for testing patterns against confidential log lines or personal data.

💬 Discuss on BestWordz Community

Join the conversation about Developer, regex tester, regex test on the BestWordz Community forum.

Visit Forum →
Copied!