Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Faker::Address.uk_postcode can generate invalid postcodes. #44

Closed
garethrees opened this Issue · 1 comment

2 participants

@garethrees

This is the regex I've been using to validate them:

/^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$/

Which seems to be the correct one, as taken from StackOverflow

Faker generated BI56 3QX for me, which when you search in Google Maps is not recognised.

@stympy stympy closed this in 23303df
@stympy
Owner

Please note that uk_postcode is deprecated... use postcode instead after setting Faker::Config.locale = 'en-gb'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.