regular expression unit structure objectives introduction concept of regular expression various types of regular expressions using match function summary bibliography unit end exercise objectives regular expressions are particularly useful for defining filters regular expressions contain series of characters that define pattern of text to be matched--to make filter more specializedor general the regular expression ^al]searches for all items beginning with al introduction regular expressions (called resor regexesor regex patternsare essentially tinyhighly specialized programming language embedded inside python and made available through the re module using this little languageyou specify the rules for the set of possible strings that you want to matchthis set might contain english sentencesor -mail addressesor tex commandsor anything you like you can then ask questions such as "does this string match the pattern?"or "is there match for the pattern anywhere in this string?you can also use res to modify string or to split it apart in various ways regular expression patterns are compiled into series of bytecodes which are then executed by matching engine written in for advanced useit may be necessary to pay careful attention to how the engine will execute given reand write the re in certain way in order to produce bytecode that runs faster optimization isn' covered in this documentbecause it requires that you have good understanding of the matching engine' internals