The exact syntax depends on your exact requirements and programming language, but basically:
/[0-9a-fA-F]+/
or more simply, i makes the case insensitive.
/[0-9a-f]+/i
If you are fortunate enough to use Ruby, you can do:
/\h+/
EDIT - Steven Schroeder's answer made me realize that my understanding of 0x bits was wrong, so I updated my suggestions accordingly. If you also want to combine 0x, equivalents
/0[xX][0-9a-fA-F]+/ /0x[0-9a-f]+/i /0x[\h]+/i
ADD MORE . If 0x should be optional (as follows from the question):
/(0x)?[0-9a-f]+/i
SimonMayer Feb 10 '12 at 1:11 2012-02-10 01:11
source share