I'm using regular expression in my project, and have an array like this :
myArray = [
r"right",
r"left",
r"front",
r"back"
]
Now I want to check if the string, for example
message = "right left front back"
has more than one match in this array, my purpose here is to have an if being true only if there is only one word matching one of the array.
I tried a lot of things, like this one
if any(x in str for x in a):
but I never make it work with a limited amount.