Compile pattern before checking