title: PHP Regex correct syntax preg_split after any number of words and 1-3 digits
body: <p>I'm trying to break down a rss feed with sports scores</p>
  
  <p><strong>Example data</strong></p>
  
  <pre><code>San Diego 4 Chicago Cubs 2
  Miami 2 Philadelphia 7
  Boston 3 Toronto 1
  Washington 3 Atlanta 1
  Chicago Sox 3 Texas 1
  St. Louis 6 Milwaukee 5 
  </code></pre>
  
  <p>The rss basically gives me one flowing string like <code>San Diego 4 Chicago Cubs 2</code> and i'm trying to break it down for better use.</p>
  
  <p>Basically im trying to first split <code>San Diego 4 Chicago Cubs 2</code> into four variables, <code>$home_team</code>, <code>$home_score</code>, <code>$away_team</code>, <code>$away_score</code>.</p>
  
  <p>But, obviously the home team could be one word or more, the score could be 1 digit or up to 3 so i've been trying to figure out the best regular expression to split this up in the correct format.</p>
  
  <p>Does anyone have any ideas?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Code that i'm actually using this for, i'm pulling xml of mlb games today, filtering out just the games that are labeled as Final meaning Final Score and then im trying to break it down further from there..</p>
  
  <pre><code>&lt;?php
  
  
  
  
  
  $xml = simplexml_load_file("http://feeds.feedburner.com/mpiii/mlb?format=xml");
  
  
  
    foreach($xml-&gt;channel-&gt;item as $item){
  
    if(preg_match('/(FINAL)/', $item-&gt;title, $matches) || preg_match('/(POSTPONED)/',   $item-&gt;title, $matches)){
  
  if(preg_match('/(POSTPONED)/', $item-&gt;title, $matches)){
      continue;
  }
  $string = $item-&gt;title;
  $patterns = array();
  $patterns[0] = '/\\(FINAL\\)/';
  $patterns[1] = '/\\(POSTPONED\\)/';
  $replacements = array();
  $replacements[1] = '';
  $replacements[0] = '';
  $string = preg_replace($patterns, $replacements, $string);
  
  
   $keywords = preg_match("^(.*?) ([0-9]{1,3}) (.*?) ([0-9]{1,3})$", $string);
   echo $keywords[1]."&lt;br/&gt;";
   }
   }
  
  
  
  
  
  
  
  ?&gt;
  </code></pre>