Developer Tools

Regex Tester

Test and debug regular expressions online for free with real-time matching and group extraction. Supports JavaScript regex syntax. No signup required.

Private by default Instant results No signup
Regex TesterLive
0Matches
0Capture groups
Highlighted matches
Overview

What is a regex tester?

A regex tester lets you write a regular expression and immediately see which parts of a piece of text it matches, without switching to a code editor and running a script just to check a pattern. It highlights every match directly in the test string, and can also preview what a find-and-replace with that pattern would produce — useful for getting a pattern right before dropping it into actual code.

This tester uses JavaScript's native regular expression engine, so a pattern that works here will behave identically inside a JavaScript or TypeScript codebase.

Guide

How to use it

1Enter a pattern and toggle the flags you need
2Paste a test string
3Review the highlighted matches
4Turn on "Enable replace" to preview a substitution

How the flags work

g (global) finds every match in the string instead of stopping at the first one. i (case-insensitive) ignores letter casing when matching. m (multiline) makes ^ and $ match the start and end of each line rather than just the whole string. s (dotall) makes . match newline characters as well, which it doesn't by default. Without the global flag, only the first match is found and highlighted — the same behavior a plain JavaScript regex would have.

Why it helps

Features & benefits

Real-time match highlighting as you type
Toggle g, i, m, and s flags individually
Preview a find-and-replace with capture group references
Clear error message for invalid patterns
Copy the pattern or the replaced result instantly
100% private — nothing leaves the device

Why this runs entirely in your browser

Test strings often contain real data pulled from logs, code, or documents, so nothing is uploaded. Matching runs using the browser's native JavaScript regex engine locally in the tab, which means it keeps working offline once the page has loaded and nothing typed or pasted into it persists after the tab is closed.

Common uses

Validating an email or phone number pattern before adding it to a form, writing a find-and-replace pattern with capture groups for a bulk text edit, debugging why a regex isn't matching expected input, or extracting a specific piece of text from a larger string using groups.

Frequently asked questions

A few things people usually want to know before trusting the numbers.

The "g" (global) flag isn't enabled. Without it, a regex only finds the first match — turn on "g" to highlight every match in the string.

Use $1, $2, and so on in the "Replace with" field to reference the first, second, and further capture groups from the pattern.

Yes. It uses JavaScript's native RegExp engine directly, so any pattern that works here behaves identically in JavaScript or TypeScript code.

It makes the dot (.) match newline characters as well, which it doesn't by default — useful when matching across multiple lines.

No. All matching and replacing happens locally in your browser. Nothing typed or pasted here is sent to a server, stored, or shared.