working with python regular expressions import re match re search(patternstringif matchprocess(matchmatch objects support range of methods and attributes includingmatch re the regular expression object whose match(or search(method produced this match instance match string the string passed to match(or search(match start([group]match end([group]return the indices of the start and end of the substring matched by group match group(returns the part of the string where there was match the search(function the search(function searches the string for matchand returns match object if there is match the signature of the function isre search(patternstringflags= the meaning of the parameters arepattern this is the regular expression pattern to be used in the matching process string this is the string to be searched flags these (optionalflags can be used to modify the operation of the search the re module defines set of flags (or indicatorsthat can be used to indicate any optional behaviours associated with the pattern these flags includeflag description re ignorecase re locale performs case-insensitive matching interprets words according to the current locale this interpretation affects the alphabetic group (\ and \ )as well as word boundary behavior(\ and \bmakes match the end of line (not just the end of the stringand makes match the start of any line (not just the start of the stringmakes period (dotmatch any characterincluding newline interprets letters according to the unicode character set this flag affects the behavior of \ \ \ \ ignores whitespace within the pattern (except inside set [or when escaped by backslashand treats unescaped as comment marker re multiline re dotall re unicode re verbose