Regular expression compiler