You most likely need a +, so regex = '^[a-fA-F0-9]+$'. However, I’d be careful to (perhaps) think about such things as an optional 0x at the beginning of the string, which would make it ^(0x|0X)?[a-fA-F0-9]+$'.
You most likely need a +, so regex = '^[a-fA-F0-9]+$'. However, I’d be careful to (perhaps) think about such things as an optional 0x at the beginning of the string, which would make it ^(0x|0X)?[a-fA-F0-9]+$'.