Summer
Summer

Reputation: 2498

Searching for a » character in a JavaScript RegExp

How can I search 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!

Upvotes: 1

Views: 152

Answers (2)

whiner
whiner

Reputation: 134

var extraLinks = /\xBB/g;

Upvotes: 4

westoque
westoque

Reputation: 417

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

Upvotes: 0

Related Questions