In brief
re.fullmatch() requires a pattern to cover the entire string. For example, re.fullmatch(r'[0-9]{4}', '1234') matches, but the same check against '1234x' does not.
Useful to know
re.fullmatch() requires a pattern to cover the entire string. For example, re.fullmatch(r'[0-9]{4}', '1234') matches, but the same check against '1234x' does not. [1]
This differs from finding an acceptable fragment somewhere in the text. Choose the appropriate scope for codes and form fields. Finding four digits does not mean the complete submitted identifier contains only those digits.
Sources
For further detail and to check the information: