I wanted to find whether the given word does not contain < > : | “. So i used the following javascript code block to find it. But it accepts all the values which has those characters also without.
$(document).ready(function() {
$('#chkResult').click(function() {
$('#resultDiv').text(/[^:<>\|"]+/.test($('#dataText').val()));
});
});
You have to set regex to test your string from the beggining to the end with
^and$:Otherwise test passes if tested string contains at least one char that does not match your group.