Are the regexes used on line 291 and 296 appropriate?