MatchesXsNonNegativeInteger🔗

Type: Pattern verification
Check that text conforms to the pattern of an xs:nonNegativeInteger.
text🔗
Text to be checked
Return🔗
True if the text conforms to the pattern

Code

non_negative_integer_rep = r"(-0|\+?[0-9]+)"

pattern = f"^{non_negative_integer_rep}$"
return match(pattern, text) is not None