Is there a way to get the regex to fail in the cases where true is not printed?