This is my code
$keywords = mysql_escape_string(preg_replace("/[^ \w]+/", '',($_POST['keywords'])));
and this my output
sample products products sample
Here I don't want to replace comma also.
The input is
sample products!@, products#$#, sample
"/[^ \w,]+/"
.... is this really rocket science?