I'm trying to do a matching using python.
I have a list of string (len~3000), and a file, and I want to check if for each line in the file, it has at least one of the strings in the list.
The most straight forward way is to check one by one, but it takes time (not that long though).
Is there a way that I can search that faster?
For example:
list = ["aq", "bs", "ce"]
if the line is "aqwerqwerqwer" -> true (since has "aq" in it)
if the line is "qweqweqwe" -> false (has none of "aq", "bs" or "ce")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With