Example of Icon's Pattern Matching

In the pattern expression languages, pattern operations are part of the language in the same way as arithmetic operations, like +, and user-defined functions:

if postalcode ?
   tab (any (letters)) & tab (any (digits)) &
   tab (any (letters)) & (=" " | "") &
   tab (any (digits)) & tab (any (letters)) &
   tab (any (digits))
then ...
New Models for Processing Text and XML with Python Sam Wilmott
Slide 14 of 51        www.wilmott.ca