Compile a regular expression pattern into a regular expression object, which can be used for matching using its match(), search() and other methods, described below.
re.compile(pattern, flags=0)
prog = re.compile(pattern)
result = prog.match(string)
result = re.match(pattern, string)