Description
The United States ZIP Code macro is used to insert United States ZIP codes into custom strings generated with the Custom String generator.
The macro is an analogue of the United States ZIP Code data generator.
Syntax
The macro is specified using the following regular expression:
[0-9]{5}(\-[0-9]{4})?
This regular expression specifies the ZIP code either in the XXXXX or in the XXXXX-XXXX format. You can change this regular expression if needed. For more information on the syntax of regular expressions, see Supported Regular Expressions.
Parameters
The macro has no parameters.
Examples
The following examples demonstrate how to use the United States ZIP Code macro:
-
[0-9]{5}
This regular expression specifies ZIP codes in the XXXXX format.
-
[1357]{5}
This regular expression specifies ZIP codes that contain only the following digits: 1, 3, 5 and 7.
-
2[0-9]{3}6
This regular expression specifies ZIP codes that start with 2 and end with 6.
-
[0-9]{5}\-[0-9]{4}
This regular expression specifies ZIP codes in the XXXXX-XXXX format.
-
[0-9]{5}(\-[0-9]{4})?
This regular expression specifies ZIP codes either in the XXXXX or in the XXXXX-XXXX format.
Remarks
-
For more information on adding macros to custom strings, see About Custom String Generator
-
For more information on general rules used for specifying macro parameters, see Custom String Generator Rules .
See Also
Macro Reference
Custom String Generator Rules
Custom String Generator
Custom-String Generator - Supported Regular Expressions
United States ZIP Code Generator
Using Data Generators
Generating Values