Optimize regex, update dependencies