I paste regex test data into a lot of places I should not trust with it. Log lines, customer emails, sample payloads — the kind of text that looks harmless until you realise you just sent it to a server you do not control.

So I test my regexes in the browser instead, in a tab where the test data stays in the tab. The tool I used for this post runs the match locally: its page says every tool runs in the browser tab and the file or text you put in is never uploaded, logged or transmitted. That is the whole point for me. Your file's contents never leave the browser.

The worked example I actually ran

I wrote this one-paragraph subject myself, so I knew exactly what should match:

Hi team, contact ada@example.com or grace@example.org about the invoice dated 2026-11-28. Sam's old address sam@old-site.net bounced on 2026-12-01, and not-an-email@ is not valid. Reach billing@toolsbyus.com before 2026-12-15. 

It is 226 bytes, one line, with four real-looking addresses, three dates, and one broken address, not-an-email@, that should not match.

First I used the tool's "Email (pragmatic)" preset, with the g and m flags on (they are on by default):

[^@\s]+@[^@\s]+\.[A-Za-z]{2,} 

The result was 4 matches in 0 ms:

  • ada@example.com at 17
  • grace@example.org at 36
  • sam@old-site.net at 108
  • billing@toolsbyus.com at 186

That preset has no capture groups, so the matches panel showed only the full match and its position — no $1 or $2. The broken not-an-email@ did not match, as it should not. The dates were ignored, which is also correct for an email pattern.

Then I tried a simpler two-group pattern to see how groups are shown:

([a-z]+)@([a-z]+) 

Same count, 4 matches in 0 ms, same flags, but now with groups:

  • ada@example at 17 — $1 ada, $2 example
  • grace@example at 36 — $1 grace, $2 example
  • sam@old at 108 — $1 sam, $2 old
  • billing@toolsbyus at 186 — $1 billing, $2 toolsbyus

The surprising part

Two things surprised me.

First, that second pattern quietly truncates every match. [a-z]+ stops at the first character it cannot match, so example.com becomes example and old-site.net becomes old. The match count still says 4, and nothing in the result warns you that you lost the rest of the domain. If I had copied those groups into code, I would have shipped a bug that looked like a passing test.

Second, the matches are not highlighted in the text I typed. I expected the addresses to light up in place; instead, the results live in the MATCHES panel on the right, with each match and its position. The page does show highlighted examples elsewhere, but in the live tester itself the subject pane is plain text and the panel is where you read the answer. Once I knew that, it was fine — but it is not what I assumed on first glance.

I also tried a pattern that matches nothing, zzz999, with the same flags. The tool showed 0 matches in 1 ms and the words "No matches." — a plain result, not an error.

Honest caveats

  • This is browser regex, which is JavaScript regex, not PCRE. A pattern that works in PHP or Python may behave differently here, especially around lookbehinds, Unicode handling, and named groups.
  • The tester cannot run your app code. It tells you whether a pattern matches a sample; it does not tell you whether your code uses the match correctly.
  • A bad pattern can still freeze a tab. The tool's page says the match runs in a Web Worker with a two-second timeout, and that the worker is terminated after that time — I did not test a catastrophic pattern myself, so I am reporting what the page states, not something I measured.
  • An email regex does not validate an email address. The preset itself says it is deliberately loose, and that sending a confirmation is the only real validation. Four matches in my test means four strings shaped like addresses, not four working mailboxes.

Try it with your own sample text here: ToolsByUs Regex Tester

It is one of 136 free tools on ToolsByUs that run in the browser.