Env Python3.6. Here's a list I want to match some sentence. (It's a bit tricky to replace it in English so I'll go with Japanese as it is.)
INPUT:
match_list=['…', '‥', '...', 'かも', '多分']
text = 'も'
if any(text in m for m in match_list):
print(text)
OUTPUT: 'も'
This output seems different from my point. It actually reacts to one of elements in the list: 'かも' But what I want to know is if the text completely matches any one of the list, not partially. Is there any better way to work it out? Thanks.