Question: write a function matches(pattern, target list): that performs a regular expression search of pattern on each of the targets in targetlist. The function should build
write a function
matches(pattern, target list):
that performs a regular expression search of pattern on each of the targets in targetlist. The function should build a list that, for each target that both successfully finds a match, and the match is the entire string, includes the matched string/target. For any target that does not match, or where less than the full target is matched, nothing is added to the resultant list.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
