title: .htaccess to WP_Rewrite regex pattern
body: <p>I have a re-write rule in .htaccess (it's working fine) that I'd like to add as WordPress wp_rewrite -
  mainly for portability and user's convenience... The question is just how the regex-pattern has to look like...</p>
  
  <pre><code>RewriteCond %{REQUEST_URI} ^/services/rest/(.*)$
  RewriteRule ^(.*)/(.*)/(.*)$ wp-content/plugins/some_plugin/api.php?action=$3 [L,NC]
  </code></pre>
  
  <p>The syntax that I would require looks about like this:</p>
  
  <pre><code>$newrules = array('^/services/rest/(.*)' =&gt; mAPI_PLUGIN_URL.'/socket.php?action=$matches[1]');
  </code></pre>
  
  <p>Any suggestions how to solve or how to improve that?</p>