Answers for "regular expression that looks for specific match in a list"

0

array search with regex python

import re

mylist = ["dog", "cat", "wildcat", "thundercat", "cow", "hooo"]
r = re.compile(".*cat")
newlist = list(filter(r.match, mylist)) # Read Note
print(newlist)
Posted by: Guest on June-13-2020

Code answers related to "regular expression that looks for specific match in a list"

Python Answers by Framework

Browse Popular Code Answers by Language