I have a list and I want only the list elements that match ALL patterns in the regex. I can't seem to figure this out, I'm new to this and thank you for your help.
The resulting print/list should only be one instance of 'panic'
import re
green = ['.a...', 'p....', '...i.']
wordlist = ['names', 'panic', 'again', '.a...']
for value in wordlist:
for pattern in green:
#print(value, pattern)
if re.match(pattern, value):
print(value)
#=>
names
panic
panic
panic
again
.a...