09-08-2010

Javascript matching special characters in JavaScript regular expressions

To match special characters in JavaScript regular expressions you can either use their predefined escape values (if they excist) or use their unicode representations.

\uhhhh matches the Unicode character with four characters of hexadecimal code hhhh.

var w = e.innerHTML.replace(/\u00A9/g,'');  //removes all copy signs;
 

List of unicode charqacters can be found here :

http://en.wikipedia.org/wiki/List_of_Unicode_characters

Character escapes can be found here:

http://www.javascriptkit.com/javatutors/redev2.shtml

Comments:

Your comment:

»

 

[x]