Regex for first 3 of Canadian Postal Code | XM Community
Skip to main content

Hi! I’m hoping someone can help. I have never created a Regex Code before. What would the regex be for the first 3 characters of a Canadian postal code (ALPHA, NUMERIC, ALPHA)?

Thanks in advance!!
Shannon

would it be ([a-zA_Z][0-9][a-zA_Z])


@Shannon OKeefe Yes, what you wrote above will only allow people to submit answers where the first three characters are in the order: alpha, numeric, alpha


Great! Thanks so much ash123


Leave a Reply