python' regular expression language the regular expression module regular expressions ||| regular expression is compact notation for representing collection of strings what makes regular expressions so powerful is that single regular expression can represent an unlimited number of strings--providing they meet the regular expression' requirements regular expressions (which we will mostly call "regexesfrom now onare defined using mini-language that is completely different from python--but python includes the re module through which we can seamlessly create and use regexes regexes are used for five main purposesparsingidentifying and extracting pieces of text that match certain criteria--regexes are used for creating ad hoc parsers and also by traditional parsing tools searchinglocating substrings that can have more than one formfor examplefinding any of "pet png""pet jpg""pet jpeg"or "pet svgwhile avoiding "carpet pngand similar searching and replacingreplacing everywhere the regex matches with stringfor examplefinding "bicycleor "human powered vehicleand replacing either with "bikesplitting stringssplitting string at each place the regex matchesfor examplesplitting everywhere colon-space or equals ("or "="occurs validationchecking whether piece of text meets some criteriafor examplecontains currency symbol followed by digits the regexes used for searchingsplittingand validation are often fairly small and understandable,making them ideal for these purposes howeveralthough good book on regular expressions is mastering regular expressions by jeffrey friedlisbn it does not explicitly cover pythonbut python' re module offers very similar functionality to the perl regular expression engine that the book covers in depth