Hello Everyone🖐!
I'm still super new to regex and need help with parsing out these Canadian Zip Codes from these addresses, what is the best formula for this and can you show what each expression means please?
Billing City / District |
land Quebec H8L 0B8 |
Toronto ON N6D 2C6 |
West Kelowna BC U2Y 4K5 |
Vancouver B.C. U7C 6B2 |
Dorval QC J8L3Z9 |
Truro NS C3M 7U3 |
Desired Outcome:
Billing City / District | Billing Zip Code |
land Quebec | H8L 0B8 |
Toronto ON | N6D 2C6 |
West Kelowna BC | U2Y 4K5 |
Vancouver B.C. | U7C 6B2 |
Dorval QC | J8L3Z9 |
Truro NS | C3M 7U3 |
Solved! Go to Solution.
Unfortunately with Regex, a field needs to have a consistent pattern to match on, and I'm not seeing that in the data you have here. What I can recommend, however, is using a free public data set of all of the cities or zip codes in Canada, and matching on that.
Here's a google search to get you started, looks like there's lots of options.
Once you have the dataset, I would suggest the following:
Let me know if this did the trick!
@nberumen do you have any luck with the following? I’m not too familiar with Canadian zip codes but from a quick Google search it seems they should always be 6 chars with an optional space?
RegEx tool, in parse mode, using expression:
\s([\w\s]{6,7})$
Thank you christina-billman and DataNath!
These both worked great and helped me out a bunch, I appreciate the help!
Thanks again,
nberumen