Related questions
Remove all special characters with RegExp
I would like a RegExp that will remove all special characters from a string. I am trying something like this but it doesn’t work in IE7, though it works in Firefox.
var specialChars = "!@#$^&%*()+=-[]\/{}|:<>?,.";
for (var …
Get Character value from KeyCode in JavaScript... then trim
This is what I have now:
$("input").bind("keydown",function(e){
var value = this.value + String.fromCharCode(e.keyCode);
}
If the e.keyCode may not be an ASCII character (Alt, backspace, del, arrows, etc.)...
I would now need to trim …
Matching special characters and letters in regex
I am trying to validate a string, that should contain letters numbers and special characters &-._ only. For that I tried with a regular expression.
var pattern = /[a-zA-Z0-9&_\.-]/
var qry = 'abc&*';
if(qry.match(…