Icon-Like Pattern Matching in Python
This is the Icon example translated into Python using an implementation based on operator overloading:
from string import letters, digits
if postalcode ^ AnyOfP (letters) & AnyOfP (digits) & \ AnyOfP (letters) & IsP (" ") [0:1] & \ AnyOfP (digits) & AnyOfP (letters) & \ AnyOfP (digits): ...