OK, fixed the if and added _ as a special. Since this code is used for matching variable names in addition to filenames, I can definitely see the value of _ as a special.