Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Unix Match. Part 1 solution in Clear category for Unix Match. Part 1 by JimmyCarlos
import re # From one esoteric language to another...
def unix_match(filename,pattern) -> bool:
regex_pattern = pattern.replace(".","\.")
regex_pattern = regex_pattern.replace("*",".*")
regex_pattern = regex_pattern.replace("?",".{1}")
return re.match(regex_pattern,filename) is not None
Aug. 5, 2019