Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
str.translate, re.match solution in Clear category for Unix Match. Part 1 by Olpag
import re
def unix_match(filename: str, pattern: str) -> bool:
pattern = pattern.translate({ord('.'): "\.", ord('*'): ".*", ord('?'): "."})
return bool(re.match(pattern, filename))
May 23, 2023