I have a string that I am copying from word document and then passing it to my text area.
The issue is that the string contains a character that appears to be Right quotation mark but jquery is unable to identify it.
I am using the following regex
return inputValue.match("^(?!.*(<|>)).*[a-zA-Z0-9 \’\‘\@\!\#\$\%\^\&\*\(\)\_\+\-\=\{\}\:\;\'\,\.\?\|\/\~\`\n]+$") == null ? true : false;
The unidentifiable strings here are
\’\‘
When I check same regex while debugging in firebug I get it as
return inputValue.match("^(?!.*(<|>)).*[a-zA-Z0-9 \ \ \@\!\#\$\%\^\&\*\(\)\_\+\-\=\{\}\:\;\'\,\.\?\|\/\~\`\n]+$") == null ? true : false;
Please note that the \’\‘
are now \ \
in jquery and hence its always failing..
I checked out further and the character comes out with Ascii Value of
‘
and
’
Please let me know a way to change these to normal single quote i.e of Ascii value 39.
or to completely remove it from the string
I know I can use a replace function to do the same, but the issue is that its not just related to single quote.. it can be any other character in future also..
So I need a foolproof solution for these illegal/Unidentifiable characters