re.findall()

re.findall(pattern, string, flags=0) Return all non-overlapping matches of pattern in string, as a list of strings. The string is scanned left-to-right, and matches are returned in the order found. If one or more groups are present in the pattern, return a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the result unless they touch the beginning of another match.

re.escape()

re.escape(string) Escape all the characters in pattern except ASCII letters, numbers and '_'. This is useful if you want to match an arbitrary literal string that may have regular expression metacharacters in it. Changed in version 3.3: The '_' character is no longer escaped.

re.fullmatch()

re.fullmatch(pattern, string, flags=0) If the whole string matches the regular expression pattern, 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. New in version 3.4.

re.error

exception re.error(msg, pattern=None, pos=None) Exception raised when a string passed to one of the functions here is not a valid regular expression (for example, it might contain unmatched parentheses) or when some other error occurs during compilation or matching. It is never an error if a string contains no match for a pattern. The error instance has the following additional attributes: msg The unformatted error message. pattern The regular expression pattern. pos The index

re.error.lineno

lineno The line corresponding to pos.

re.error.colno

colno The column corresponding to pos.

re.compile()

re.compile(pattern, flags=0) Compile a regular expression pattern into a regular expression object, which can be used for matching using its match() and search() methods, described below. The expression’s behaviour can be modified by specifying a flags value. Values can be any of the following variables, combined using bitwise OR (the | operator). The sequence prog = re.compile(pattern) result = prog.match(string) is equivalent to result = re.match(pattern, string) but using re.compile() a

re.error.msg

msg The unformatted error message.

range.stop

stop The value of the stop parameter

range.step

step The value of the step parameter (or 1 if the parameter was not supplied)