0

Regex Tester Online

Debug JavaScript regular expressions live: highlighted matches, capture groups, flags, and replacement preview.

Supports $1, $2 and named references like $<name>; $& inserts the whole match. Leave empty to hide the preview.

Processing... 0%

Result

This regex tester is a live workbench for developing and debugging JavaScript regular expressions. Type a pattern, toggle the g, i, m, s and u flags, and paste any test text: matches are highlighted directly in the text as you type, a counter shows how many were found, and a detailed list breaks every match down into its numbered and named capture groups. Syntax errors do not just fail silently — the tester shows the exact message from the JavaScript engine, so a stray bracket or an invalid quantifier is caught immediately.

It is built for pattern development, not one-off text operations. When you are designing a capture for a log parser, testing which URL formats a validation accepts, or learning what lookaheads actually do, you need to see groups, positions and edge cases — that is what this tool shows. For simple everyday find or find-and-replace jobs on a piece of text, the dedicated search-in-text and replace-in-text tools are quicker; this tester is where you go to get the pattern itself right.

The replacement mode turns it into a refactoring preview: enter a replacement string with $1, $& or $<name> references and see the transformed text side by side with the original before you commit the expression to code. Combined with the preset pages — ready-made patterns for emails, URLs, phone numbers, IP addresses, dates and password policies — it doubles as a practical reference for common real-world expressions.

Everything executes locally in your browser using the native JavaScript RegExp engine — the same engine that will run your pattern in production JS code, so what matches here matches there. No text or patterns are uploaded anywhere, which makes it safe to debug expressions against real logs, customer data samples or configuration files, even offline.