Fix PCRE checks, and make code build cleanly without regex