- Use Pattern::compile() to check regex correctness