Generate address
Generates a random postal address
Evaluation
This expression evaluates to a function of the form:
(seed) -> any
The function is consistent with generator semantics of the Random Data step.
Processing
Given a seed value, the function returns a pseudo-random dict value of the following form:
{
:street string,
:house_number string,
:postal_code string,
:city string
}
A concrete value might look like this:
{
:street 'Wintercress Terrace',
:house_number '7',
:postal_code '75146',
:city 'Greenham'
}
Street and city names are generated by combining elements from several pools of name fragments and words.
A large number of distinct combinations is possible.
House number and postal code are each generated to adhere to a given regular expression pattern.
The following regular expression syntax is supported
Pattern | Description |
---|---|
. |
Any symbol |
? |
One or zero occurrences |
+ |
One or more occurrences |
* |
Zero or more occurrences |
\d |
A digit. Equivalent to [0-9] |
\D |
Not a digit. Equivalent to [^0-9] |
\s |
Any whitespace character: carriage return, space, tab, newline, vertical tab, form feed |
\S |
Anything but a whitespace character |
\w |
Any word character. Equivalent to [a-zA-Z0-9_] |
\W |
Anything but a word character. Equivalent to [^a-zA-Z0-9_] |
\i |
Places same value as capture group with index i , i is any integer number. |
\xXX and \x{XXXX} |
Hexadecimal value of unicode characters 2 or 4 digits |
{a} and {a,b} |
Repeat a; or min a max b times. |
[...] |
Single character chosen from characters inside brackets. Use the dash to specify ranges i.e: [a-zA-Z] |
(a|b) |
Alternatives |
[^...] |
Single character not in brackets. For example: [^a-z] - any symbol except lowercase letters |
() |
Group multiple characters for repetitions or alternatives |
\ |
Escape character - use to treat characters with special meaning as literals
|
Settings
Name | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Postal Code Pattern |
string |
Regular expression specifying the format of the generated postal code. Examples:
|
||||||||
House Number Pattern |
string |
Regular expression specifying the format of the generated house number. Examples:
|
||||||||
Chance of nil |
double |
Probability in range of 0.0 to 1.0 that the generator will return nil instead of generating a value. |