I know the easiest way is using a regular expression, but I wonder if there are other ways to do this check.
Why do I need this? I am writing a Python script that re
Another option:
def is_hex(s): hex_digits = set("0123456789abcdef") for char in s: if not (char in hex_digits): return False return True