6.0.0-beta1
9/22/25

[#3541] Improper regular expressions for matching addresses in Horde/UI/VarRenderer/html.php
Summary Improper regular expressions for matching addresses in Horde/UI/VarRenderer/html.php
Queue Horde Base
Queue Version 3.1-RC3
Type Bug
State Resolved
Priority 1. Low
Owners
Requester voegelas (at) gmx (dot) net
Created 02/27/2006 (7147 days ago)
Due
Updated 03/02/2006 (7144 days ago)
Assigned
Resolved 03/02/2006 (7144 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
03/02/2006 05:31:59 PM Chuck Hagenbuch Comment #2
State ⇒ Resolved
Reply to this comment
"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.
I've added the word boundary checks, thanks.
BTW, what about adding comments with example addresses that show
what address style these regular expressions are supposed to match?
Sounds good. If you could submit a patch for it that'd be great. If 
you're not quite up to a patch, you could start a small wiki page - 
probably under the developer docs, http://wiki.horde.org/Doc/Dev
with notes on the code.
02/27/2006 09:31:12 AM voegelas (at) gmx (dot) net Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Improper regular expressions for matching addresses in Horde/UI/VarRenderer/html.php
Queue ⇒ Horde Base
Reply to this comment
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


Saved Queries