Regular Expressions ------------------- What? ----- x an x (literal) . any character [aeiou] 1 of these char's (character class) [a-n] 1 of these char's (ASCII range character class) [^aeiou] NOT 1 of these char's (negative char. class) \d a digit (class shorthand) \D NOT a digit (negative class) \w a word character (class shorthand) \W NOT a word character (negative class) \s a "whitespace" character (class shorthand) \S NOT a "whitespace" character (negative class) How many? --------- x* 0 or more x's x+ 1 or more x's x? 0 or 1 x x{4,8} as few as 4 or as many as 8 x's x{10,} 10 or more x's x{75} exactly 75 x's Grouping -------- (bamm)+ 1 or more 'bamm' Alternation ----------- this|that 'this' or 'that' Where? (Anchors) ---------------- ^x x at the beginning x$ x at the end \b a word boundary \B NOT a word boundary Back reference -------------- (b[aio]m)\1 'bambam' or 'bimbim' or 'bombom' (NOT 'bimbam', etc.)