fixed bug whereby regexes were not being properly matched