All tools

Regex Cheatsheet

Development

Concise JavaScript Regular Expression reference covering anchors, quantifiers, and lookarounds.

Character Classes

.Any character except newline
\d / \DDigit [0-9] / Non-digit [^0-9]
\w / \WWord [A-Za-z0-9_] / Non-word
\s / \SWhitespace / Non-whitespace
[xyz] / [^xyz]Any of x, y, z / None of x, y, z

Quantifiers & Anchors

^ / $Start / End of string
\bWord boundary
* / + / ?0+ / 1+ / 0 or 1
{n} / {n,m}Exactly n / Between n and m

Groups & Lookarounds

(foo)Capturing group
(?:foo)Non-capturing group
foo(?=bar)Positive lookahead
foo(?!bar)Negative lookahead
(?<=bar)fooPositive lookbehind