Regular expression tokens with descriptions and examples. JavaScript flavor.
/^hello/→ matches hello at the start/world$/→ matches world at the end/\bcat\b/→ matches cat, not concatenate/\Bcat\B/→ matches concatenate, not cat/c.t/→ matches cat, cut, c3t/[aeiou]/→ matches any vowel/[^aeiou]/→ matches any non-vowel/[a-z]/→ matches any lowercase letter/\d+/→ matches 42, 007/\D+/→ matches abc, hello/\w+/→ matches hello_world/\W+/→ matches spaces and punctuation/\s+/→ matches spaces and tabs/\S+/→ matches non-space tokens/ab*/→ matches a, ab, abb, abbb/ab+/→ matches ab, abb (not a)/colou?r/→ matches color and colour/\d{4}/→ matches exactly 4 digits/\d{2,}/→ matches 2 or more digits/\d{2,4}/→ matches 2, 3, or 4 digits/<.*?>/s→ matches shortest tag/\d+?/→ matches minimal digits/colou??r/→ prefers color over colour/(\w+)@(\w+)/→ captures username and domain separately/(?:ab)+/→ matches ababab without capturing/(?<year>\d{4})-(?<month>\d{2})/→ groups.year, groups.month/(\w+) \1/→ matches repeated words like the the/(?<q>['"]).*?\k<q>/→ matches matching quote pairs/cat|dog/→ matches cat or dog/\d+(?= dollars)/→ matches 100 in '100 dollars'/\d+(?! dollars)/→ matches numbers not followed by dollars/(?<=\$)\d+/→ matches digits after $/(?<!\$)\d+/→ matches digits not preceded by $/abc/g→ returns all matches/hello/i→ matches Hello, HELLO, hello/^\w+/m→ matches first word of every line/foo.bar/s→ matches across newlines/\u{1F600}/u→ correctly matches emoji code points/\d+/y→ matches only at current position/line1\nline2/→ matches across a newline/\r\n/→ matches Windows line ending/\t/→ matches tab character/\0/→ matches null byte/\x41/→ matches A (0x41)/\u00E9/→ matches é/\u{1F600}/u→ matches 😀