From the documentation, it's very clear that:
match()
-> apply pattern match at the beginning of the stringsearch()
-> search through the string and return first match
And search
with '^'
and without re.M
flag would work the same as match
.
Then why does python have match()
? Isn't it redundant?
Are there any performance benefits to keeping match()
in python?