compile regular expressions