How match() function is different from search() function ?
Question :
How match() function is different from search() function ?
The match() function returns a match object if the text matches the pattern. Otherwise it returns None. The match() functions looks for a pattern at the beginning of a string. The search() function checks for a match anywhere in the string. If there is more than one match, only the first occurrence of the match will be returned.