hola...
perdon por mi ignorancia no? pero que es regex ?
en php para filtrar caracteres peligrosos, o sql inyection usamos
stripslashes();
http://ar2.php.net/manual/es/function.stripslashes.php
y
htmlentities();
http://ar2.php.net/manual/es/function.htmlentities.php
saludos....
PD. para ver algunos comentarios o ejemplo en el foro ... te paso el link
http://www.forosdelweb.com/f18/script-seguridad-php-314635/