Regular Expressions

Regular expression pattern rules

     text        Match literal text
     .           Match any character except newline
     ^           Match the start of a string
     $           Match the end of a string
     *           Match 0 or more repetitions
     +           Match 1 or more repetitions
     ?           Match 0 or 1 repetitions
     *?          Match 0 or more, few as possible
     +?          Match 1 or more, few as possible
     {m,n}       Match m to n repetitions
     {m,n}?      Match m to n repetitions, few as possible
     [...]       Match a set of characters
     [^...]      Match characters not in set
     A | B       Match A or B
     (...)       Match regex in parenthesis as a group
<<< O'Reilly OSCON 2000, Advanced Python Programming, Slide 25
July 17, 2000, beazley@cs.uchicago.edu
>>>