0[xX][0-9a-fA-F]+(\.[0-9a-fA-F]+)?([pP][+-]?\d+)?.
0[xX][0-9a-fA-F]+(\.[0-9a-fA-F]+)?([pP][+-]?\d+)?
Pretty simple. The pP[+-]?\d+ part is for detecting hex exponents, which use P instead of E like base 10 exponents do.