title: Need help with some regular expressions in PHP
body: <p>I need to port some simple <a href="http://us2.php.net/manual/en/function.eregi.php" rel="nofollow noreferrer">eregi</a> regular expressions to <a href="http://us2.php.net/manual/en/function.preg-match.php" rel="nofollow noreferrer">preg_match</a> for PHP 5.3/6.0 compilance.</p>
  
  <p>Since I'm not too confident in my regular expression porting skills I need some help...</p>
  
  <p><strong>#1</strong></p>
  
  <p>Old version:</p>
  
  <pre><code>if( eregi('foo',$myVar) ) {
      $aresult = explode('/',stristr($myVar,'foo'));
      $aversion = explode(' ',$aresult[1]);
  }
  </code></pre>
  
  <p>New version:</p>
  
  <pre><code>if( preg_match('/Foo\/([^ ]*)/i',$myVar,$matches) ) {
      $aversion = $matches[1];
  }
  </code></pre>
  
  <p><strong>#2</strong></p>
  
  <p>Old version:</p>
  
  <pre><code>if( eregi('bar',$myVar) &amp;&amp; ! eregi('rv:[0-9]\.[0-9]\.[0-9]',$myVar)) {
      $aresult = explode('/',stristr($myVar,'bar'));
      $aversion = explode(' ',$aresult[1]);
  }
  </code></pre>
  
  <p>New version:</p>
  
  <pre><code>//Not done yet need help
  </code></pre>