title: php preg_match() multiple patterns
body: <p>Would be possible to return the result of preg_match under the same array index in case of multiple patterns. What I mean I have the following preg_match what is checking occurrences on different sub strings (<code>'&amp;q'</code> , <code>'?q'</code> , <code>'&amp;keywords'</code>).  </p>
  
  <pre><code>preg_match('/&amp;q=(.+?)(&amp;|$)|\?q=(.+?)(\&amp;|$)|\&amp;keywords=(.+?)(\&amp;|$)/', urldecode($test_string), $matches); 
  </code></pre>
  
  <p>I would like to see all occurrences under <code>$matches[1]</code> to can exclude the following <code>if</code> statement.  </p>
  
  <pre><code>if($matches){   
              if ($matches[1] != ''){
                $query_p = mysql_escape_string($matches[1]);      
              } elseif ($matches[3] != ''){   
                $query_p = mysql_escape_string($matches[3]);      
              } elseif($matches[5] != ''){
                $query_p = mysql_escape_string($matches[5]);
              }
           }
  </code></pre>