Check based on a regexp matching only hexadecimal

Comparing strings based on this regexp should be more accurate than current implementation.