simplified some regexes to speed up detection