re the re module is used to perform regular-expression pattern matching and replacement in strings both unicode and byte-strings are supported regular-expression patterns are specified as strings containing mix of text and special-character sequences because patterns often make extensive use of special characters and the backslashthey're usually written as "rawstringssuch as '(? \ +)(\ *)for the remainder of this sectionall regular-expression patterns are denoted using the raw string syntax pattern syntax the following special-character sequences are recognized in regular expression patternscharacter(sdescription text matches the literal string text matches any character except newline matches the start of string matches the end of string matches zero or more repetitions of the preceding expressionmatching as many repetitions as possible matches one or more repetitions of the preceding expressionmatching as many repetitions as possible matches zero repetitions or one repetition of the preceding expression matches zero or more repetitions of the preceding expressionmatching as few repetitions as possible matches one or more repetitions of the preceding expressionmatching as few repetitions as possible matches zero or one repetitions of the preceding expressionmatching as few repetitions as possible matches exactly repetitions of the preceding expression matches from to repetitions of the preceding expressionmatching as many repetitions as possible if is omittedit defaults to if is omittedit defaults to infinity matches from to repetitions of the preceding expressionmatching as few repetitions as possible matches set of characters such as '[abcdef]or '[ -za- ]special characters such as are not active inside set matches the characters not in the setsuch as '[^ - ]matches either or bwhere and are both regular expressions matches the regular expression inside the parentheses as group and saves the matched substring the contents of group can be obtained using the group(method of matchobject objects obtained while matching *+?{ {mn{mn}[ | continues lib fl ff