Indirection

Pattern matching
Pattern matching via indirection. Try setting your pattern matches into a global array so that they can be accessed dynamically.

e.g for postcodes by country:-

set ^postcode("UK")=".2U.2N1"" ""1N2U" set ^postcode("NL")="4N1"" ""2U" set code="1017 ZL" set country="NL" set ok=code?@^postcode(country)