title: Edit regex to recognise very short street name or number for Python 2.7 script and avoid fatal attribute error
body: <p>I have a little script in Python 2.7 with regex that recognises when a street or avenue name is in a string. However it doesn't work for street names of only two letters (OK that's very rare) OR streets with numbers (e.g. 29th Street)... I'd like to edit it to make the latter work (e.g. recognise 29th street or 1st street).</p>
  <p>This works:</p>
  <pre><code>import re
  
  def street(search):
      if bool(re.search('(?i)street', search)):
          found = re.search('([A-Z]\S[a-z]+\s(?i)street)', search)
          found = found.group()
          return found.title()
      if bool(re.search('(?i)avenue', search)):
          found = re.search('([A-Z]\S[a-z]+\s(?i)avenue)', search)
          found = found.group()
          return found.title()
      else:
          found = &quot;na&quot;
          return found
  
  userlocation = street(&quot;I live on Stackoverflow Street&quot;)
  
  print userlocation
  </code></pre>
  <p>Or, with &quot;Stackoverflow Avenue&quot;</p>
  <p>......but these fail:</p>
  <pre><code>userlocation = street(&quot;I live on SO Street&quot;)
  userlocation = street(&quot;I live on 29th Street&quot;)
  userlocation = street(&quot;I live on 1st Avenue&quot;)
  userlocation = street(&quot;I live on SO Avenue&quot;)
  </code></pre>
  <p>with this error (because nothing found)</p>
  <pre><code>me@me:~/Documents/test$ python2.7 test_street.py
  Traceback (most recent call last):
    File &quot;test_street.py&quot;, line 12, in &lt;module&gt;
      userlocation = street(&quot;I live on 29th Street&quot;)
    File &quot;test_street.py&quot;, line 6, in street
      found = found.group()
  AttributeError: 'NoneType' object has no attribute 'group'
  </code></pre>
  <p>As well as correcting the query so that it recognises &quot;1st&quot;, &quot;2nd&quot;, &quot;80th&quot;, &quot;110th&quot; etc., I'd also ideally like to avoid a fatal error if it doesn't find anything.</p>