Regular Expression Cheatsheet

Character classes . – Matches any character except newline\d – Digit (0-9)\D – Not a digit (0-9) – opposite of \d\w, [A-Za-z0-9_], [:word:] – Word character (a-z, A-Z, 0-9 and _)\W, [^A-Za-z0-9], [^:word:] – Not a word character\s – Whitespace (space, tab, newline)\S – Not whitespace (space, tab, newline) – opposite of \s[] – Matches…