Reading and compiling regex