Is there a way that I could search for 2 or more words in a string using regular expressions in Python.
for example, if I have a list of strings like this:
[red_house, red_door, red_seat, green_door, green_house, green_table]
... and I wanted to return red_house specifically, I could do:
red_house = [obj for obj in list if re.search("red", obj) and re.search("house", obj)]
but is it possible to combine these 2 re.search's into 1?
Cheers,