Parsing street addresses in Ruby

前端 未结 5 1761
萌比男神i
萌比男神i 2021-02-09 18:08

I am processing addresses into their respective field format for the database. I can get the house number out and the street type but trying to determine best method to get the

5条回答
  •  不知归路
    2021-02-09 18:36

    You could perhaps use something like:

    ^\S+ (.+?) \S+$

    \S matches any non white space character

    ^ matches the beginning of the string

    $ matches the end of the string

    And (.+?) captures anything in between the two.

提交回复
热议问题