use proper error handling, and skipp regexp when not compiling