Here too, can just do the preg_match test inside the `if` case.