In-built Datatypes and Regular Expressions

Hi there

I’m new here and playing around with Mockaroo I’ve noticed that it says you can use its in-built datatypes with regular expressions but there seem to be no examples.

What I’m trying to do is add some data that takes the inbuilt ‘Street Address’, ‘City’ and the expression ‘@@## #@@’ and adds them together to make one string of data, for example “762 Jenifer Alley, London, SW11 4AA”, How would I do this?

Also, can I limit the generated data to a specific region, ie: UK?

Many thanks in advance.

Martin

Hi @themartincotterill If you include the field type ‘Country’ and set the ‘restrict countries’ box to United Kingdom it will limit to UK. While City is UK placenames, not all are city or even post towns - some are villages. Also many of the street addresses are obviously US addresses.

You can use the Digit Sequence field to randomly generate postcode like strings, though you might have to be quite creative to get more than one of the many formats of UK postcode. When I did a postcode, I uploaded a list of the valid first part of postcode for my area, then used a digit sequence for the second part. I then used the template field to join them together.
{__postcode1} {__postcode2}

Thanks @mp_np. This will do nicely.

I managed to find out how to put the address into one line by adding hidden fields and then joining them together in a visible field, as you’ve shown, ie {__street}, {__city} and {_postCode}. For my post code I just used a regular expression as it isn’t critical for my purposes but I like your idea for UK post codes.

Thanks for the info on setting the country restriction, much appreciated.

Once again, many thanks.
Martin