Adding a rewrite rule to wordpress using regex
<p>I'm trying to write a rewrute rule for wordpress:  </p>

<pre><code>add_rewrite_rule( '(.*)/([0-9]+)/?$', 'index.php?name=$matches[1]&amp;p=$matches[2]','top' ); // check for not page in matches[1]
</code></pre>

<p>I want to add two more conditions in <code>$matches[1]</code> i.e. <code>(.*)</code> should not contain any <code>/</code> and also should not contain the string <code>page</code>.</p>

<p>To sum up, I want to match only strings like:  </p>

<pre><code>/abc/232
</code></pre>

<p>But not these:  </p>

<pre><code>/abc/sdsd/232
/page/232
</code></pre>