View Single Post
  #3 (permalink)  
Old 04-15-2007, 09:23 AM
Tenshi Tenshi is offline
Junior Member
 
Posts: 8
Default

Don't know if it can help you, but I worked this morning on a regex to identify canadian addresses...

Haven't tested it extensively yet, but it seems to work so far... (for Canadian and US addresses at least)

Code:
\b\d+[A-Za-z]?[ ]+([ewns]\.?[ ]+)?[A-Za-z0-9]+([ ]+[A-Za-z0-9]+)*[\s,\.](\s*(\#|[A-Za-z]+[,\.]?)[ ]*\d+[\s,\.])?\s*[A-Za-z]+([ ]+[A-Za-z]+)*[ ,][ ]*[A-Za-z]{2}([A-Za-z]+([ ][A-Za-z]+)?)?[ ]+((\d{5})|(-\d{4})|([ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d))\b
It doesn't need the CA at the end to identify Canada, since there is the postal code... In any case, this regex works if you enter "2924 11 Calgary, AB T2E 7L7"

If you plan on using this zimlet, delete the one you already have and rename this one com_zimbra_ymaps.zip if you want to integrate correctly... if you don't rename it, it will complain that it can't find the zimlet or report installation successful over it will not be active
Attached Files
File Type: zip com_zimbra_ymaps_modifiedregex.zip (3.9 KB, 64 views)

Last edited by Tenshi; 07-01-2007 at 05:58 AM..
Reply With Quote