Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
re.search+lambda=3 lines solution in Clear category for Unix Match. Part 1 by alterGNU
import re
def unix_match(filename: str, pattern: str) -> bool:
dico={"*":"\S*","?":"\S",".":"\."}
convert = lambda p: "".join([ dico[e] if e in dico else e for e in p ])
return bool(re.search(convert(pattern),str(filename)))
June 6, 2021