M
mikewolfbaltimore
Hello all
have a regex question... I want to split an address into descrete parts
so
709 S Milton Ave is split into
number = 709
Direction = S
Name = Milton
Type = Ave
So I have the following regex
(?<number>^\d*(\s\w|\w|\-\w|\s\d/\d))\s(?<direction>(n\.|N\.|s\.|S\.|E\.|e\.|W\.|w\.|NE\.|ne\.|SE\.|se\.|NW\.|nw\.|SW\.|sw\.|n|N|s|S|E|e|W|w|NE|ne|SE|se|NW|nw|SW|sw|North|East|West|South|north|south|west|east)*)(?<street>(.*[^street|place|drive|st|pl|dr|ave|av])*)(?<type>.*)
Which works for the folowing address
709 S S Milton ave (as in 709 S South Milton ave)
as that S is part of the number
but does not work for
709 S Milton ave
because it thinks that the S is part of the number and not the
direction....
any ideas
have a regex question... I want to split an address into descrete parts
so
709 S Milton Ave is split into
number = 709
Direction = S
Name = Milton
Type = Ave
So I have the following regex
(?<number>^\d*(\s\w|\w|\-\w|\s\d/\d))\s(?<direction>(n\.|N\.|s\.|S\.|E\.|e\.|W\.|w\.|NE\.|ne\.|SE\.|se\.|NW\.|nw\.|SW\.|sw\.|n|N|s|S|E|e|W|w|NE|ne|SE|se|NW|nw|SW|sw|North|East|West|South|north|south|west|east)*)(?<street>(.*[^street|place|drive|st|pl|dr|ave|av])*)(?<type>.*)
Which works for the folowing address
709 S S Milton ave (as in 709 S South Milton ave)
as that S is part of the number
but does not work for
709 S Milton ave
because it thinks that the S is part of the number and not the
direction....
any ideas