switched preg_match for ctype_xdigit