开发者

Searching for a » character in a JavaScript RegExp

开发者 https://www.devze.com 2022-12-18 13:03 出处:网络
How can I sear开发者_开发技巧ch for a » character in a JavaScript regexp? Code that\'s not working right now:

How can I sear开发者_开发技巧ch for a » character in a JavaScript regexp?

Code that's not working right now:

var extralinks = new RegExp('»','g');  
div.innerHTML = div.innerHTML.replace(extralinks,'This is special punctuation');  

Grazie!


var extraLinks = /\xBB/g;


look up the ASCII table and escape the character http://www.asciitable.com/

0

精彩评论

暂无评论...
验证码 换一张
取 消