Skip to content
T
Tools.Town
Free Online Tools for Everyone
/\d+/g

Regex Tester

100% Free

Live regex testing with highlighted matches, capture groups, named groups, and JS-engine flag toggles (i/m/s/u/y).

Real-time
Client-Side
JS engine
Highlighted matches 2 matches
Email me at alice@example.com or bob@test.io
Match details
Match 1at index 12
alice@example.com
$1alice
$2example.com
Match 2at index 33
bob@test.io
$1bob
$2test.io

Embed This Tool

Easy to Embed

Add Regex Tester to your website or blog in seconds.

  • Responsive design
  • Lightweight & fast
  • No backend required
  • Always up-to-date
<iframe
  src="https://tools.town/embed/regex-tester/"
  width="100%"
  height="600"
  style="border:none; border-radius:12px;"
  loading="lazy"
  title="Regex Tester">
</iframe>

Share This Tool

Share Instantly

Share Regex Tester with anyone — no login required.

  • Shareable link
  • No login required
  • Works on any device
  • No account needed

Share via

Advertisement

How to Use

  1. 1 Type your regex pattern (without surrounding slashes)
  2. 2 Toggle flags as needed: i, m, s, u, y
  3. 3 Type or paste test text
  4. 4 Matches highlight in yellow, with capture groups listed below

Features

  • Live highlighting of all matches
  • Capture groups numbered ($1, $2, …)
  • Named groups (?<name>…) shown separately
  • All 5 user-toggleable JS flags
  • Always uses 'g' globally — find every match
  • Parse errors surface with the engine's exact message

Why it Matters

Regex is the universal text-processing tool but writing one by trial and error is slow. A live tester with highlighted matches and group breakdowns turns a 30-minute debug into 30 seconds — easier than firing up a Node REPL or a regex testing site that requires an account.

★★★★★

Use Cases

Build a Validator

Iterate on a regex for email/phone/URL validation

Log Scraping

Test a pattern against a sample log line before deploying

Learning Regex

See exactly what each part of your pattern matches

Frequently Asked Questions

Which regex flavour does this use?
JavaScript's native RegExp engine — same behaviour as your browser's. NOT Perl-compatible (PCRE), NOT POSIX. Most patterns are interchangeable but some lookbehind / Unicode features differ.
Why is the 'g' flag forced on?
Without 'g', JavaScript's matchAll throws. We always want every match for a useful tester, so 'g' is implicit.
What does the 'y' (sticky) flag do?
Matches only at the regex's `lastIndex` position — useful for tokenizers but rarely for one-off patterns. Toggle on if you need it.

Related Tools You Might Like

Browse more free tools