This RegEx is for cleanup user input from a search form
$query = preg_replace("/[^A-Za-z0-9 _.,*&-]/", ' ', $query);
I need to add the slash as a valid character too, but if I add it, I get an error. I assume I have to escape it but can't find how to do that
$query = preg_replace("/[^A-Za-z0-9 _.,*&-/]/", ' ', $query); // doesn't works
$query = preg_replace("/[^A-Za-z0-9 _.,*&-//]/", ' ', $query); // doesn't works
$query = preg_replace("/[^A-Za-z0-9 _.,*&-\/]/", ' ', $query); // doesn't works
Using php