Hello guys, i have problem with regular expression , I have search box, I tried to enter (',#,$,%,^,&,"star",@,!,") or any other special charachters, it give me the whole database items, so i want to limit the enrty to only letters [a-z] numbers [0-9] and arabic charachters [ا-ي]
or to be clear any letter is allowed except for special charachters
I used this but it not allowed english
if(preg_match('/[^\w\d_ -]/si', $search)) {
echo " You entered not allowed letters";
exit();
}
and if I put !preg_match
the arabic will not be allowed, what should I put in regexp ? BTW spaces are allowed