Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
12-liner: 'replace' * 11 solution in Creative category for Unix Match. Part 3 by Stensen
unix_match = lambda f, p: __import__('re').match(p
.replace('.', r'\.')
.replace('*', r'.*')
.replace('?', r'.')
.replace('[!]', r'\[\!\]')
.replace('[!', '[^')
.replace('[.]', r'\?')
.replace('[[]', r'\[')
.replace('[]]', r'\]')
.replace('[][]', r'[\[\]]')
.replace('[.*]', r'\*')
.replace('[]', '[^.]'), f) is not None
Nov. 19, 2020