Test a regular expression against your text in real time. See every match highlighted, with capture groups and flags. Runs entirely in your browser.
How to use the Regex Tester
Type your regular expression in the pattern field.
Toggle the flags (g, i, m, s, u) you need.
Enter the test string and see matches highlighted with their groups.
The regex tester lets you build and debug regular expressions against your own sample text, with matches highlighted live as you type. It is useful for validating input formats, extracting fields from logs, or testing a pattern before pasting it into code.
Everything runs in your browser, so your patterns and test text are never uploaded.
It uses the JavaScript regular-expression engine, the same one in every browser and in Node.js, so a pattern that works here works in your JavaScript and TypeScript code.
Toggle the global, case-insensitive, multiline and other flags to change how a pattern matches. You see every match along with its capture groups, so you can confirm exactly what each part of the pattern is pulling out.
Other languages such as PCRE, Python and Go share most syntax but differ in some features, so a few advanced constructs may behave differently outside JavaScript. If a pattern works here but not in another language, an engine-specific construct is usually the reason.
Frequently asked questions
The JavaScript (ECMAScript) engine built into your browser, so results match what your JavaScript and TypeScript code will do.
g matches all occurrences, i ignores case, m makes ^ and $ match at line breaks, s lets the dot match newlines, and u enables full Unicode handling.
Enable the multiline (m) flag so ^ and $ match at each line break, and add the dotAll (s) flag if you also need the dot to match newline characters.
Yes. Each match lists its numbered capture groups, and named groups appear by name, so you can see exactly what each part of the pattern captured.
This uses the JavaScript engine. PCRE, Python and others share most syntax but differ in lookbehind, named groups and some escapes, so port advanced patterns with care.
No. The pattern and your test text are evaluated entirely in your browser and never leave your device.
Embed this tool
Add this tool to your own website. Copy the snippet below; it stays up to date automatically.
<iframe src="https://monu.tools/embed/en/regex-tester" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>Learn more
Regex Basics: Characters, Classes, Anchors, and Quantifiers
The core building blocks of regular expressions: literal characters, character classes, anchors, quantifiers, and the flags that change everything.
Capturing Groups, Named Groups, and Backreferences
How parentheses capture parts of a match, how to name them, how backreferences match repeated text, and how to use all three when replacing.
Lookahead and Lookbehind: Matching by Context
Lookarounds check what surrounds a position without consuming it. Learn positive and negative lookahead and lookbehind with practical examples.
Greedy, Lazy, and Catastrophic Backtracking
Why quantifiers grab as much as they can, how lazy matching reins them in, and how nested quantifiers cause the ReDoS slowdown to avoid.
Why You Should Not Validate Email With a Giant Regex
The full RFC email regex is thousands of characters, rejects valid addresses, accepts dead ones, and risks ReDoS. Here is what to do instead.
Related tools
Build and check cron expressions. Pick a preset or edit the five fields, and see the next run times in your time zone. Runs entirely in your browser.
Format, beautify and validate JSON online with clear error messages for invalid input.
Encode text to Base64 or decode Base64 back to text. UTF-8 safe with automatic direction detection.
Generate 5 random RFC 4122 version 4 UUIDs at once. The input is ignored; run again for a new batch.