Skip to content

Instantly share code, notes, and snippets.

@sauron918
Last active October 12, 2017 06:36
Show Gist options
  • Select an option

  • Save sauron918/a5f4f9d1ae2dd20b77ca447038816237 to your computer and use it in GitHub Desktop.

Select an option

Save sauron918/a5f4f9d1ae2dd20b77ca447038816237 to your computer and use it in GitHub Desktop.
Parse street name and house number

Regular expression for parsing street name and house number:
^([^\d]*[^\d\s]) *(\d.*)

Examples:
'Long Street 106 - 108 A' => 'Long Street', '106 - 108 A'
'Street 145' => 'Street', '145'
'Street56a' => 'Street', '56a'
'Some Avenue 68' => 'Some Avenue', '68'
'Some Ave 999a' => 'Some Ave', '999a'
'Singlestreet551abc' => 'Signlestreet', '551abc'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment