I need a python regular expression to check if a word is present in a string. The string is separated by commas, potentially.
So for example,
line =
As everyone else has mentioned it is better to use the "in" operator, it can also act on lists:
line = "This,is,a,sample,string" lst = ['This', 'sample'] for i in lst: i in line >> True >> True