Regular expression parser / generator