Difference Between re.search and re.match in Python

Difference Between re.search and re.match in Python

re.match() checks for a match only at the beginning of the string, while re.search() checks for a match anywhere in the string (this is what Perl does by default).

Source

Leave a Reply

Your email address will not be published. Required fields are marked *