What is the regular expression for space and alpha-numeric
<p>I'm using ajax check function to check inserted category name which should be only alpha-numeric and also allowed space</p>

<p>I've used this function <code>eregi_replace</code> with the following regular expression <code>[a-zA-Z0-9_]+</code></p>

<pre><code>$check = eregi_replace('([a-zA-Z0-9_]+)', "", $catname);
</code></pre>

<p>But when i insert category name for example <code>hello world</code> it failed cause it does not accept space but if i write it as <code>helloworld</code> works so i understood that the error must be in the regular expression i'm using. </p>

<p>so what is the correct regular expression that filter any special characters and allow only for alpha-numeric and space.</p>

<p>Thanks a lot</p>
