How to Use This Tool
A regular expression is easy to write and hard to be sure about. The gap between "it matched my three test strings" and "it is correct" is where most regex bugs live, and the only reliable way to close it is to watch the matches highlight against real data as you type.
Writing and testing
Type the pattern in the top field — without the surrounding slashes, which are shown for you. Flags go in the box after, or use the checkboxes. The test string below highlights every match live, and the panel underneath lists each match with its position and every capture group broken out separately.
Capture groups are the part worth paying attention to. A pattern that matches is only half the job; if you are extracting data you need the groups to land where you expect. The list shows group 1, group 2 and any named groups by name, per match, so a mistake is visible immediately rather than three functions later.
? after a quantifier makes it lazy. This one character is the difference
between four tags and one enormous match, and it is the second most common regex mistake.Timeout for slow patterns
Nested quantifiers such as (a+)+b can trigger catastrophic backtracking (ReDoS) on a near-match. This page runs matching and replacement in a separate browser worker. If the entire evaluation has not finished within 800 milliseconds, the page terminates that worker instead of blocking the interface.
The worker protects this preview, not another service that later uses the pattern. Before production use, test representative and adversarial inputs in the target engine and apply that runtime’s own limits.
Replace preview
The bottom field previews a replacement across the whole test string. Use $1,
$2 for capture groups and $& for the whole match. Getting a replacement right
in a preview takes seconds; getting it wrong in a script that has already rewritten four hundred files takes
considerably longer.
JavaScript regex flavor and other languages
This tester uses the JavaScript regular expression engine provided by the current browser. It does not emulate Python, C#, Java, .NET, PowerShell, PCRE or Go. Those runtimes can differ in syntax, flags, Unicode behavior and replacement tokens. Treat this result as a JavaScript check, then run the pattern in the engine where it will be used.

