def isHexEncodedString(subject):
 return (re.match('\\A[0-9a-fA-Fx]+\\Z', subject) is not None)

def isHexEncodedString ( subject ) : return ( re . match ( '\\A[0-9a-fA-Fx]+\\Z' , subject ) is not None )
checks if the provided string is hex encoded .