Condense _get_val_err function and pre-compile all regex's