regular expressions table the regular expression module' functions syntax description re compilerfreturns compiled regex with its flags set to if specified (the flags are described in table re escape(sreturns string with all nonalphanumeric characters backslash-escaped--thereforethe returned string has no special regex characters re findallrsfreturns all nonoverlapping matches of regex in string (influenced by the flags if givenif the regex has captureseach match is returned as tuple of captures re finditerrsfreturns match object for each nonoverlapping match of regex in string (influenced by the flags if givenre matchrsfreturns match object if the regex matches at the start of string (influenced by the flags if given)otherwisereturns none returns match object if the regex matches anywhere in string (influenced by the flags if given)otherwisereturns none returns the list of strings that results from splitting string on every occurrence of regex doing up to splits (or as many as possible if no is givenand for python influenced by flags if givenif the regex has capturesthese are included in the list between the parts they split re searchrsfre splitrsmfre subrxsmfreturns copy of string with every (or up to if givenand for python influenced by flags if givenmatch of regex replaced with --this can be string or functionsee text re subnrxs mfthe same as re sub(except that it returns -tuple of the resultant string and the number of substitutions that were made table the regular expression module' flags flag meaning re or re ascii makes \ \ \ \ \wand \ assume that strings are asciithe default is for these character class shorthands to depend on the unicode specification re or re ignorecase makes the regex match case-insensitively re or re multiline re or re dotall makes match at the start and after each newline and match before each newline and at the end makes match every character including newlines re or re verbose allows whitespace and comments to be included