I have an ASP.NET/C# application that has a form field that asks the user for their location, which we take and pass to Bing Maps for geocoding purposes. For some reason my client wants to limit input to these three formats:
San Francisco, CA 91111
San Francisco, CA
91111
However, I know they'll also end up asking for support for Canadian postal codes as well.
Of course, they ask for this 2 hours before the launch of the project so I don't really have too much time to research regex myself and figure it out (I'm terrible at regex) so I figured I'd ask here.
Can anyone come up a RegEx that I can use to validate that it fits one of the above three formats, with support for canadian postal codes as well (doesn't have to support ZIP+4).