Skip to content

Instantly share code, notes, and snippets.

@aspyct
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspyct/8438cd37ba65d9269514 to your computer and use it in GitHub Desktop.
Save aspyct/8438cd37ba65d9269514 to your computer and use it in GitHub Desktop.
Parse a belgian street address
^
(?# 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