Update matching algorithm to match multiple regular expressions at once.