This website uses cookies to improve your experience. By using our site, you agree to our Cookie Policy.

Regex Tester

Test regular expressions against real text with live match highlighting, capture groups, replace preview, and a built-in cheat sheet. Runs entirely in your browser.

Live Highlighting
Capture Groups
Replace Preview
Cheat Sheet
100% Private
0
Total Matches
0
Capture Groups
Valid
Pattern Status
g
Active Flags
Regular Expression PATTERN
/ / g
Test String INPUT
Highlighted Matches OUTPUT
Match Details 0 MATCHES
No matches yet — enter a pattern and test string above.
Replace Preview
Replace with:
Quick Cheat Sheet — click to insert
Done!

Understanding Regex Basics

Character Classes

\d digits, \w word chars, \s whitespace, [abc] any of a/b/c.

Quantifiers

* zero or more, + one or more, ? optional, {n,m} a range of repeats.

Anchors

^ start of string/line, $ end of string/line, \b word boundary.

Groups

(...) capturing group, (?:...) non-capturing, (?...) named group.

How to Use the GST & VAT

1

Write Your Pattern

Type a regular expression in the pattern field. Errors are flagged instantly if the syntax is invalid.

2

Toggle Flags

Turn on global, ignore-case, multiline, dotAll, or unicode flags to change how the pattern matches.

3

Add Test Text

Paste any text into the test string box — matches are highlighted live as you type.

Inspect & Replace

Check capture groups per match, or preview a full find-and-replace using $1, $2 group references.

Frequently Asked
Questions

1. Which regex flavor does this tool use?

This tool uses JavaScript’s native RegExp engine — the same one used in browsers and Node.js. Syntax is very close to PCRE, though a few features (like recursive patterns) aren’t supported.

Make sure the “g” (global) flag is enabled. Without it, JavaScript regex only returns the first match found in the string.

Wrap parts of your pattern in parentheses to create groups, then reference them in the replacement field as $1, $2, etc. Named groups like (?<year>\d{4}) can be referenced as $<year>.

The “m” (multiline) flag makes ^ and $ match the start/end of each line instead of the whole string. The “s” (dotAll) flag makes . also match newline characters, which it normally doesn’t.

No. Everything — pattern compilation, matching, and replacement — runs locally in your browser via JavaScript’s RegExp engine. Nothing is uploaded anywhere.

Let's Talk