I am trying to cut lines containing "msi" using regular expressions and list comprehension. However, when I print the list, lines containing "msi" are still in the list. What would be the mistake? This is my code:
spam_list = [l for l in spam_list if not re.match("msi", l)]
source share