Pattern What it does . Matches a single character (including spaces!) (excluding newlines if dotall is not set to True) \d Matches a digit \D Matches a non-digit \s Matches a whitespace character (newline, tab, space, etc) \S Matches a non-whitespace character [abc] Matches the character a, b, or c [a-zA-Z] Matches a character in the range a-z or A-Z [^<] Matches a character OTHER than the < bracket. p+ Matches 1 or more instances of pattern p p? Matches 0 or 1 instances of pattern p p* Matches 0 or more instances of pattern p p{m} Specific Number of patterns: Matches exactly m instances of pattern p p{m,n} Specific range of numbers of a pattern: Matches m to n instances of pattern p | A|B Matches either A or B \\b word boundary!! (Must be escaped because \b stands for backspace or use raw.) >>> findall("\\b[gt]+\\b", "gt ggt gtgt catgt") ['gt', 'ggt', 'gtgt'] >>> findall(r"\b[gt]+\b", "gt ggt gtgt catgt") # or can sometimes use r for raw string ['gt', 'ggt', 'gtgt'] \w matches an alphanumeric character Capturing versus non-capturing ------------------------------ >>> findall("ani(m)al", "animalFOXanimal") ['m','m'] >>> findall("ani(?:m)al", "animalFOXanimal") ['animal','animal'] >>> findall("ani(m)a(l)", "animalFOXanimal") [('m', 'l'), ('m', 'l')] (p) Capturing Group - Groups multiple patterns together such that everything inside the group is considered one pattern. Only the data within a capturing group (or groups) will be returned by the findall function call. (?:p) Non-Capturing Group - Like a capturing group, but doesn’t cause python to split up what’s in the group from the rest of the pattern when you use findall. This is useful if you need to repeat the entire pattern inside the group multiple times, but want to capture the entire RegEx. Note that some characters have special meanings within a regular expression, So if you want to match one of those characters you will probably have to “escape” it much like you escape a newline or tab character, using a backslash. Here are some examples of how you can match these “special” characters. Pattern What it does . Matches any character (including spaces!) (excluding newlines if dotall is not set to True) \. Matches (only) a period in the text. $ Matches the end of a string (NOT a dollar sign!) \$ Matches a dollar sign in the text \( Matches a begin parenthesis that is in the text, and is not intended to be the beginning of a capturing group.