[Tickets #3541] NEW: Improper regular expressions for matching addresses in Horde/UI/VarRenderer/html.php

bugs@bugs.horde.org bugs at bugs.horde.org
Mon Feb 27 01:31:12 PST 2006


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=3541
-----------------------------------------------------------------------
 Ticket             | 3541
 Created By         | voegelas at gmx.net
 Summary            | Improper regular expressions for matching addresses in Horde/UI/VarRenderer/html.php
 Queue              | Horde Base
 Version            | 3.1-RC3
 State              | Unconfirmed
 Priority           | 1. Low
 Type               | Bug
 Owners             | 
-----------------------------------------------------------------------


voegelas at gmx.net (2006-02-27 01:31) wrote:

The regular expression ACT|NSW|NT|QLD|SA|TAS|VIC|WA for matching Australian
addresses also matches addresses that contain the text "USA", ie. US
American addresses. I think that the regex should check for word boundaries:
\b(ACT|NSW|NT|QLD|SA|TAS|VIC|WA)\b. Possibly, the regex for UK addresses
should also be updated.

BTW, what about adding comments with example addresses that show what
address style these regular expressions are supposed to match?

The code for European style addresses doesn't seem to match German
addresses. At least, not the address style suggested by the German Post.
Here's an example for national mail:

Muster GmbH                 COMPANY NAME (optional, of course)
Max Mustermann             FIRST NAME followed by LAST NAME
Musterstr. 1a                  STREET or P.O. BOX
12345 Musterhausen       POSTAL CODE followed by CITY NAME

The German postal code must never be prefixed with "D-" although there are
still people who do this. Instead, the country name must be given in German,
French or English on another line. An example for international mail:

John Dundee
Harbour Place 4
CANBERRA ATC 4568
AUSTRALIEN





More information about the bugs mailing list