simple compiler for regex