re.fullmatch(pattern, string, flags=0)
The re.fullmatch function checks whether the entire text string satisfies the regular expression pattern, returning the corresponding match object. If the regular expression is not found, the function returns None.
- pattern: Search pattern.
- string: Text in which to search.
- flags: Search modifiers.
The re.fullmatch function returns an object of type match or None if the regular expression is not satisfied.
We can check whether or not a full text satisfies a regular expression with the following code:
re.fullmatch(pattern, text)
However, the following text does not satisfy the search pattern in its entirety, so the re.fullmatch function returns None (which is why nothing is displayed on the screen):
re.fullmatch(pattern, text)