regex.subn(repl, string, count=0) Identical to the subn() function, using the compiled pattern.
regex.sub(repl, string, count=0) Identical to the sub() function, using the compiled pattern.
regex.split(string, maxsplit=0) Identical to the split() function, using the compiled pattern.
regex.pattern The pattern string from which the RE object was compiled.
regex.search(string[, pos[, endpos]]) Scan through string looking for the first location where this regular expression produces a match, and return a corresponding match object. Return None if no position in the string matches the pattern; note that this is different from finding a zero-length match at some point in the string. The optional second parameter pos gives an index in the string where the search is to start; it defaults to 0. This is not completely equivalent to slicing the string
regex.finditer(string[, pos[, endpos]]) Similar to the finditer() function, using the compiled pattern, but also accepts optional pos and endpos parameters that limit the search region like for match().
regex.match(string[, pos[, endpos]]) If zero or more characters at the beginning of string match this regular expression, return a corresponding match object. Return None if the string does not match the pattern; note that this is different from a zero-length match. The optional pos and endpos parameters have the same meaning as for the search() method. >>> pattern = re.compile("o") >>> pattern.match("dog") # No match as "o" is not at the start of "dog". >>> p
regex.fullmatch(string[, pos[, endpos]]) If the whole string matches this regular expression, return a corresponding match object. Return None if the string does not match the pattern; note that this is different from a zero-length match. The optional pos and endpos parameters have the same meaning as for the search() method. >>> pattern = re.compile("o[gh]") >>> pattern.fullmatch("dog") # No match as "o" is not at the start of "dog". >>> pattern.fullmatch("og
regex.groups The number of capturing groups in the pattern.
regex.flags The regex matching flags. This is a combination of the flags given to compile(), any (?...) inline flags in the pattern, and implicit flags such as UNICODE if the pattern is a Unicode string.
Page 242 of 663