Regex Tester
Test, inspect, and replace regular expressions
$& full match · $1 capture group · $` before · $' after
Advertisement
Test JavaScript regular expressions with live match highlighting, capture groups, replace preview, and g, i, m, and s flags.
Test, inspect, and replace regular expressions
$& full match · $1 capture group · $` before · $' after
Interactive regex tester with live match highlighting, capture group display, replace preview, JSON/CSV match export, and shareable URL state. Supports g, i, m, and s flags.
What you get with Regex Tester.
Matches are highlighted as you type your pattern.
Displays each group's value and index.
Test replacement strings with backreferences.
Toggle g, i, m, and s flags.
Follow these steps to get the best results.
Type a regular expression and toggle the flags you need (g, i, m, s).
Matches are highlighted live and each capture group's value is listed.
Switch to the Replace tab, enter a replacement string, and see the result before using it in code.
Advertisement
Common questions about Regex Tester.
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.
Advertisement
Comments
Share feedback, ask questions, or help others use this tool.
Join the discussion
Sign in to comment, reply, and report inappropriate content.