In my current regular expression, I am negating digits:
$(function(){
$("#somewhat").bind("keyup",
function(event) {
var regex = /^[\D]*$/;
alert(regex.test($("#somewhat").val()));
});
});
What I have in my mind is to add some special characters on which I should negate, !@#$%^&*()_+=<>.?/~`:;" , and leaving dash, apostrophe ( -' ) to the valid list. I'm still kind of dizzy on this regular expression thing. To test with, I added + on the regex,
var regex = /^[\D+]*$/;
When I test it, the alert box returns TRUE, which is not I am expecting.