FINDZIP

Returns the ZIP Code™ from a string. EngageOne™ Enrichment searches from the end to the beginning of the string, matching patterns as follows:

ZIP Code™ Type Pattern
5-digit #####
5 + 4 #####-####
5 + 4 + 2 #####-####-##

Syntax

FINDZIP(string)

Arguments

Argument Description Default
string The string to search for the ZIP Code™. FINDZIP does not determine whether the ZIP Code™ found is valid. EngageOne™ Enrichment will not find a ZIP Code™ that contains spaces or non-numeric characters. None

Results

Result Description
Return A string that contains the ZIP Code™ from string.
%%RC One of the following:
0 No error.
1 ZIP Code™ not found.
%%RM A null string ('').
%%RV One of the following, based on the ZIP Code™ pattern found:
5 #####
4 #####-####
2 #####-####-##
0 ZIP Code™ not found.

Examples

Function Call Return %%RC %%RV
FINDZIP('Lex. KY 4051A') '' 1 0
FINDZIP('Lex KY, 40513-2739 USA') '40513-2739' 0 4
FINDZIP(' PO Box 27394, Lex KY 40513') '40513' 0 5
FINDZIP(' Zip 40513-2739-01') '40513-2739-01' 0 2
FINDZIP('Lex KY 40513 - 2739') '40513' 0 5