moves filterRegex away from regexes
moves invalid character checking away from regexes. no more regexes used in parsing!