Allow more flexibility in exception match check