Advertisement
/ /

Match Preview

Output will appear here as you type…
Quick Reference ▸
.Any character except newline
\dDigit [0-9]
\wWord char [a-zA-Z0-9_]
\sWhitespace
\bWord boundary
^Start of string / line
$End of string / line
*0 or more (greedy)
+1 or more (greedy)
?0 or 1 / lazy modifier
{n,m}Between n and m times
[abc]Character class
[^abc]Negated character class
(abc)Capture group
(?:abc)Non-capturing group
a|bAlternation (a or b)
(?=abc)Positive lookahead
(?!abc)Negative lookahead
Advertisement

Frequently Asked Questions

The global flag makes the regex find all matches in the string, not just the first one. Without it, the regex stops after the first match.
Parentheses create a capture group: (\d+). Each group captures a portion of the match that you can reference separately. They are numbered from left to right starting at 1.
Greedy quantifiers (*, +) match as much as possible. Lazy quantifiers (*?, +?) match as little as possible. Example: on aXbXc, a.*c matches the whole string, while a.*?c would not match unless there was a shorter path.