tool / text

Regex Tester

Live regex matching with coloured capture groups, match positions, and one-click patterns for common formats. Zero network requests.

← Back to tools
/ /
Quick:
Test Text
Highlighted

Capture Groups

Groups are colour-coded by index: group 1 is blue, group 2 green, group 3 orange, group 4 pink. Full matches with no groups are highlighted in yellow.

Flags

  • g — find all matches, not just the first
  • i — case-insensitive matching
  • m^ and $ match line boundaries
  • s — dot matches newlines (dotall mode)
  • u — full Unicode support

How to Use

  • Type a regex pattern in the top bar.
  • Toggle flags as needed.
  • Paste test text — matches highlight in real time.
  • Use Quick buttons to load common patterns instantly.

Why Test Before You Ship

Regex fails quietly. A pattern that works on your three test strings misses the fourth format in production — or worse, backtracks catastrophically and pins a CPU. This tester runs your pattern live as you type and cuts off any run that exceeds 400 ms, flagging it as possible catastrophic backtracking. Better to find that out here than in an incident channel.

Real-World Uses

  • Log mining: paste a chunk of server logs, hit the IPv4 quick button, and every address lights up with its exact character position in the match list.
  • Validation rules: build the email or phone check for a form here and throw ugly edge cases at it before it starts rejecting real users.
  • Extraction patterns: capture groups pull the pieces out — the colour coding shows exactly what each set of parentheses grabbed, so (\w+)@([\w.]+) visibly splits an address into user and domain.

FAQ

Which regex flavor is this?

JavaScript's, exactly as your browser implements it. Patterns behave the same as they will in Node or frontend code. PCRE-only syntax like possessive quantifiers won't work here — and wouldn't work in your JS either.

Does my test text go anywhere?

No. Matching runs entirely in your browser with zero network requests, so you can paste logs or customer data without worrying about it.

Why did my pattern get cut off?

Runs longer than 400 ms are stopped and flagged. Nested quantifiers like (a+)+ are the usual culprit — rewrite the pattern to remove the ambiguity.

What about more than four capture groups?

Groups five and up reuse the fourth colour in the highlight view, but the match list below still labels every group by its number.

// huntermussel

Need to automate data extraction and pattern matching at scale?

HunterMussel builds intelligent automation workflows that extract, validate, and route structured data from unstructured sources — using AI agents and rule engines.

Explore Intelligent Automation →

Advertisement · Publicidade