What is the best way to search for matching words inside a string?
Right now I do something like the following:
if re.search('([h][e][l][l][o])',file_name_tmp, re.IGNORECASE):
Which works but its slow as I have probably around 100 different regex statements searching for full words so I'd like to combine several using a | separator or something.
[]is really pointless. Get a decent introduction to regexes, you seem to have trouble with at least one if its most basic parts...if re.search('hello'),file_name_tmp, re.IGNORECASE)would be exactly the same.