Test and debug regular expressions with real-time matching, capture group extraction, and match highlighting. All processing happens locally in your browser.
Type your regex pattern in the input field. Use the "Common Patterns" dropdown to quickly load patterns for emails, URLs, phone numbers, and more.
Choose the flags you need: global (g) to find all matches, case-insensitive (i) to ignore letter case, multiline (m) to match across lines, and others.
Paste or type the text you want to test. Matches are highlighted in real-time as you type. Invalid patterns will show error messages.
See all matches highlighted, with details showing position and capture groups. Use the Replace feature to test substitutions with $1, $2 for groups.
Regular expressions are patterns that describe sets of strings. The regex engine scans the input text character by character, trying to match the pattern. When a match is found, it records the position and matched text.
Engine starts at the beginning of the input string. Attempts to match the pattern at each position. Backtracks when a partial match fails. Records matches and capture groups. With global flag, continues after each match.
g (global): Find all matches, not just the first. i (ignoreCase): Case-insensitive matching. m (multiline): ^ and $ match line boundaries. s (dotAll): Dot (.) matches newlines too. u (unicode): Treat pattern as Unicode sequence. y (sticky): Match only at lastIndex position.
Character classes like \d (digit), \w (word character), \s (whitespace). Anchors like ^ (start) and $ (end). Quantifiers like * (0+), + (1+), ? (0-1), {n} (exactly n). Groups using () for capturing and | for alternation.
Text matched by portions of the pattern inside parentheses () is "captured" for later use. In replacement strings, use $1 for the first group, $2 for the second, and so on. Non-capturing groups (?:...) group without capturing.
Complex patterns with many quantifiers can be slow. Avoid "catastrophic backtracking" with nested quantifiers. Be specific rather than using .* when possible. Use non-capturing groups when you don't need the captured text.
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. It's used for pattern matching in strings - finding, replacing, or validating text that matches specific criteria.
gSaved Presets is a Supporter feature.
Tool History is a Supporter feature.
Tool Notes is a Supporter feature.
.Any character\dDigit [0-9]\wWord char\sWhitespace^Start of line$End of line*0 or more+1 or more?0 or 1{n}Exactly n[abc]Any of a, b, c(group)Capture group