pattern compiling