DevTools Hub

Search tools

Search for a developer tool

Regex

Regex Tester

Test JavaScript regular expressions with live match highlighting.

Part of the Regex Toolkit
//gi
2 matches
Contact us at support@devstoolshub.com or sales@devstoolshub.com for help.
Matches & groups
  • [14] "support@devstoolshub.com"
    groups: $1="support"$2="devstoolshub.com"
  • [42] "sales@devstoolshub.com"
    groups: $1="sales"$2="devstoolshub.com"

Testing JavaScript regular expressions

This tool runs your pattern against the test string using the browser's native RegExp engine — the exact same engine your JavaScript code will use at runtime, so what you see here is exactly what you'll get in production. Already know what you want to match but not the syntax for it? The Regex Builder lets you click together a pattern instead of writing it from scratch.

Common flags

FAQ

Do you have ready-made patterns for common things like email, UUIDs, phone numbers, domains, or URLs?

See Regex for Email, Regex for UUID, Regex for Phone Number, Regex for Domains, and Regex for URLs for practical patterns, what each part matches, and their known limitations — paste any of them here to test against your own strings.

Why do numbered groups show as $1, $2...?

That's the standard reference syntax for capture groups in JavaScript replacement strings — group 1 is the first (...) in your pattern, in order.

The pattern doesn't match what I expect — how do I see why?

Paste it into the Regex Visualizer to see the pattern broken down into groups, alternatives, and quantifiers — it's often faster to spot a misplaced quantifier or an unintended group boundary in a diagram than in the raw string.

Where can I look up what a token means?

The Regex Cheat Sheet Generator is a customizable syntax reference you can filter and export as Markdown or plain text.

My pattern seems to hang instead of failing — what's going on?

That's a sign of catastrophic backtracking. The Regex Debugger steps through a single match attempt one piece at a time and flags the nested-quantifier shapes that cause it.

Related tools