Moved some regexes out of functions so they don't get re-instantiated each time.