title: Parsing street addresses in Ruby
body: <p>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 street without number and last word. A standard street address received would be:  </p>
  
  <pre><code>    res[:address] = '7707 Foo Bar Blvd'
  </code></pre>
  
  <p>As of now I can parse the following:</p>
  
  <pre><code>    house = res[:address].gsub(/\D/, '')
      street_type = res[:address].split(/\s+/).last
  </code></pre>
  
  <p>My first challenge is how to get 'Foo Bar'.  Note the street name could be one, two or three words.  I am struggling to find a one line expression solution for this in Ruby.</p>
  
  <p>My second question is how to perhaps improve on the 'house' code to deal with house numbers that have an alpha at the end.  For example, "7707B".</p>
  
  <p>Lastly if you can reference a good cheat sheet with examples for these expression that would be helpful.</p>