- Developer Tools · Free · No Sign-up
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.
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
Write Your Pattern
Type a regular expression in the pattern field. Errors are flagged instantly if the syntax is invalid.
Toggle Flags
Turn on global, ignore-case, multiline, dotAll, or unicode flags to change how the pattern matches.
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.
2. Why aren't I seeing multiple matches?
Make sure the “g” (global) flag is enabled. Without it, JavaScript regex only returns the first match found in the string.
3. How do capture groups work in the replace box?
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>.
4. What does the "m" and "s" flag actually change?
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.
5. Is my text or pattern sent to a server?
No. Everything — pattern compilation, matching, and replacement — runs locally in your browser via JavaScript’s RegExp engine. Nothing is uploaded anywhere.