MatchesXsHexBinary🔗

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

Code

hex_binary = r"([0-9a-fA-F]{2})*"

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