Handle the case where the regex is invalid

Should just return false as quickly as possible