Groups
Groups
Sign in
Groups
Groups
GeoNames
Conversations
About
Send feedback
Help
Canadian postal code regex
62 views
Skip to first unread message
Liam Morland
unread,
Jan 7, 2013, 1:38:41 PM
1/7/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to geon...@googlegroups.com
In this file:
http://download.geonames.org/export/dump/countryInfo.txt
the Canadian postal code regex is shown as:
^([a-zA-Z]\d[a-zA-Z]\d[a-zA-Z]\d)$
There ought to be a space between the first three and last three characters. This is correctly done in the postal code format: "@#@ #@#".
Some letters are not used in Canadian postal codes, so a better regex is this:
^([ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]) ?(\d[ABCEGHJKLMNPRSTVWXYZ]\d)$
Marc Wick
unread,
Jan 9, 2013, 3:11:23 PM
1/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to geon...@googlegroups.com
Hi Liam
Thanks. The regex has been changed.
Best Regards
Marc
> --
> You received this message because you are subscribed to the Google
> Groups "GeoNames" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/geonames/-/L6APm0-Zdb4J
.
> To post to this group, send email to
geon...@googlegroups.com
.
> To unsubscribe from this group, send email to
>
geonames+u...@googlegroups.com
.
> For more options, visit this group at
>
http://groups.google.com/group/geonames?hl=en
.
Reply all
Reply to author
Forward
0 new messages