~/cheatsheets/regex
Published on

Regex

CharacterDescription
\dShorthand for [0-9]
\wWord character ([A-Za-z0-9_])
\sWhitespace character ([ \t\r\n\f])
^Start of line
$End of line
?=Positive Lookahead

Examples

foo must appear anywhere and baz must appear anywhere, not necessarily in that order.

(?=.*foo)(?=.*baz)