title: regex to address if number exists
body: <p>I'm searching for php regex to split street and house number, but when address hasn't house number it should give only street name.</p>
  
  <p>I have this one:</p>
  
  <pre><code>/([^\d]+)\s?(.+)/i
  </code></pre>
  
  <p>It works but when an address hasn't a house number, then it splits the last letter from the street name.</p>
  
  <p>This is my code:</p>
  
  <pre><code>$result = mysqli_query($db, "SELECT street FROM branch;");
  $row = mysqli_fetch_assoc();
  
  while($row = mysqli_fetch_assoc($result))
  {
      if ( preg_match('/([^\d]+)\s?(.+)/i', $row['street'], $street) )
      {
         $streetName = $street[1];
         $streetNumber = $street[2];
         echo $streetName;
         echo "&lt;br /&gt;";
      }
  }
  </code></pre>
  
  <p>Examples of addresses:
  UL.JANA PAWLA, UL.GDANSKA 83A, UL.MOSTOWA 5</p>