Advertisement
Regex Tester – Test Regular Expressions Online
TrendingTest and debug regular expressions with real-time match highlighting. Supports capture groups, replace preview, and all JavaScript regex flags.
Regex Tester
Test, debug and explore regular expressions in real time
Quick reference
.Any character (except newline)\dDigit [0–9]\DNon-digit\wWord char [a-zA-Z0-9_]\WNon-word character\sWhitespace\SNon-whitespace\bWord boundary^Start of string / line$End of string / line*0 or more (greedy)+1 or more (greedy)?0 or 1 — or lazy quantifier{n,m}Between n and m times(…)Capture group(?:…)Non-capturing group(?=…)Positive lookahead(?!…)Negative lookahead(?<=…)Positive lookbehind[abc]Character class[^abc]Negated character classa|bAlternation (a or b)Click any token to append it to your pattern.
What is Regex Tester?
Interactive regex tester with live match highlighting, capture group display, and replace preview. Supports all JavaScript flags (g, i, m, s, u, y). Includes a regex cheat sheet and common pattern library.
Regex Tester Features
Real-Time Highlighting
Matches are highlighted as you type your pattern.
Capture Groups
Displays each group's value and index.
Replace Preview
Test replacement strings with backreferences.
All JS Flags
g, i, m, s, u, y — toggle any combination.
Advertisement
Regex Tester FAQ
Check: (1) missing 'g' flag for multiple matches, (2) 'i' flag for case-insensitive matching, (3) escaped special characters like \. instead of ., (4) 'm' flag for multiline strings.
JavaScript (ECMAScript) regular expressions. Syntax is compatible with Node.js and all modern browsers.
Escape them with a backslash: \. matches a literal dot, \( matches a literal parenthesis. Without escaping, these are metacharacters with special meaning.
Greedy quantifiers (*, +, {n,m}) match as much as possible. Add a ? after the quantifier to make it lazy (*?, +?, {n,m}?), which matches as little as possible. Lazy matching is useful for extracting specific segments from HTML or structured text.