Regex Tester

Test a regular expression against sample text with live match highlighting and detailed capture group breakdown.

//gi
Test String
Highlight Match Results2 matches
Contact ada@example.com or alan.turing@bletchley.ac.uk for details.
Capture Groups & Details
#0Index @8
ada@example.com
#1Index @32
turing@bletchley.ac

Regex Tester & Debugger Online

Writing regular expressions can be notoriously difficult. Our free online Regex Tester & Debugger allows you to write, test, and evaluate complex regular expressions against sample text with real-time visual feedback. Instantly see where your expression matches, and easily inspect captured groups.

JavaScript Engine: This tool uses your browser's native JavaScript RegExp engine. This makes it a perfect testing ground for regex patterns you intend to use in Node.js, React, or vanilla JS applications.

Core Features

  • Live Match HighlightingAs you type your regular expression or modify your test data, the tool instantly highlights every match directly within the text area.
  • Capture Group ExtractionMatches are automatically broken down into an easy-to-read table showing exactly which text was captured by which numbered group in your regex.
  • Flag SupportEasily toggle common flags like Global (g), Case-Insensitive (i), and Multiline (m) to alter how your pattern behaves.

Common Regex Patterns

Email Address
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
URL (HTTP/HTTPS)
^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$
Strong Password
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$

Frequently Asked Questions

What does the "g" (Global) flag do?
Without the Global (g) flag, a regular expression will stop searching immediately after it finds the very first match in your text. Enabling the Global flag tells the engine to continue searching for every occurrence of the pattern throughout the entire document.
Are JavaScript regular expressions the same as Python or PHP?
Mostly, but not exactly. All modern languages use PCRE (Perl Compatible Regular Expressions) as a base, so 95% of standard syntax (like \d, +, *, [a-z]) is identical. However, advanced features like lookbehinds ((?<=...)) or named capture groups are handled slightly differently depending on the specific language engine and version.