Fixed the hex value box management with a switch statement and RegEx.