applies to the immediately preceding character(sand indicates to match zero or one time ?applies to the immediately preceding character(sand indicates to match zero or one time in "non-greedy mode[aeioumatches single character as long as that character is in the specified set in this exampleit would match " "" "" "" "or " "but no other characters [ - - you can specify ranges of characters using the minus sign this example is single character that must be lowercase letter or digit [^ -za-zwhen the first character in the set notation is caretit inverts the logic this example matches single character that is anything other than an uppercase or lowercase letter when parentheses are added to regular expressionthey are ignored for the purpose of matchingbut allow you to extract particular subset of the matched string rather than the whole string when using findall(\ matches the empty stringbut only at the start or end of word \ matches the empty stringbut not at the start or end of word \ matches any decimal digitequivalent to the set [ - \ matches any non-digit characterequivalent to the set [^ - bonus section for unix linux users support for searching files using regular expressions was built into the unix operating system since the and it is available in nearly all programming languages in one form or another as matter of factthere is command-line program built into unix called grep (generalized regular expression parserthat does pretty much the same as the search(examples in this so if you have macintosh or linux systemyou can try the following commands in your command-line window grep '^from:mbox-short txt fromstephen marquard@uct ac za fromlouis@media berkeley edu fromzqian@umich edu fromrjlowe@iupui edu this tells grep to show you lines that start with the string "from:in the file mbox-short txt if you experiment with the grep command bit and read the documentation for grepyou will find some subtle differences between the regular expression support in python and the regular expression support in grep as an examplegrep does not support the non-blank character \ so you will need to use the slightly more complex set notation []which simply means match character that is anything other than space