moved valid_regexes into utils