fixing tests, compile regular expressions beforehand