Last active
August 29, 2015 14:10
-
-
Save aspyct/8438cd37ba65d9269514 to your computer and use it in GitHub Desktop.
Parse a belgian street address
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^ | |
(?# street - required)([^/\n]+?) | |
(?# separator)[\s,]+ | |
(?# number - required)(\d[\w-]*) | |
(?# box - optional)(?:\s*(?:bte|bus|boite|box|/)\s*(.+?))? | |
(?# trailing whitespaces)\s* | |
$ | |
(?# | |
FIXME: how to make a difference between a ‘/‘ and ‘/b’, | |
when the ‘b’ could be part of the box? | |
Proposed solution: keep the b in the box number. | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment