This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def say_if_match(patt, test, id): | |
if re.match(patt, test): | |
print('{}: match!'.format(id)) | |
return re.match(patt, test) | |
# Metacharacters | |
# '*': zero or more repetitions of previous thing |