Better regular expression for hex values

Thanks to @jaronbarends