title: RegEx match string separated by space
body: <p>I've to validate a string pattern representing 2-2 letter language codes (see <a href="https://www.facebook.com/translations/FacebookLocales.xml" rel="nofollow"><em>FacebookLocales.xml</em></a>):</p>
  
  <pre><code>$languages = 'af_ZA ak_GH am_ET ar_AR as_IN ay_BO az_AZ be_BY';
  </code></pre>
  
  <p>So far I could come up with this:</p>
  
  <pre><code>preg_match ( "/^([a-z]{2}_[A-Z]{2}\s)+$/", $languages );
  </code></pre>
  
  <p>This works fine if there's a trailing space, if the trailing space is removed then it returns 0;</p>