/^ # start of string 0x # 0x prefix [0-9A-F] # a hex digit {1,4} # 1 to 4 of them $ # end of string /xi # x = allow spaces & comments in regexp # i = ignore case