As others recommended "create a whitelist" but I really wanted to create a blacklist. this is my code
if($("#txtTag").val().length <=0 || $("#txtTag").val() =="")
{
$("#ep-insert-keyword").html("Please Enter Keyword");
$("#ep-insert-keyword").fadeIn("normal");
}
else if(!RegexCheck(/^[a-zA-Z\_]+$/g,$("#txtTag").val()))
{
$("#ep-insert-keyword").html("Special characters are not allowed");
$("#ep-insert-keyword").fadeIn("normal");
}
I want to prevent my users to enter any special character I defined in my regex. the characters i want to prevent are this ranges of characters in ASCII
0-47 58-64 91-96 123-127
I really want to reverse my code from whitelist to BLACKLIST... but i don't know how.
I don't worry about other languages as i really want them to pass my validation... i just want to block the characters on the ASCII ranges i wanted