I am trying to identify substrings in a given string using str.contains while mixing the OR and AND
I know that OR can be represented by |
str.contains("error|break|insufficient")
and that AND can be represented by AND
str.contains("error|break|insufficient") & str.contains("status")
I would like to mix the OR and AND together. Example is to identify strings that have "error" OR "break OR ("insufficient" AND "status")
So for sentence like "error break insufficient" -> it will be able to identify. But now is not able to because there is no "status" in the sentence