I'm using this code I stumbled upon to 'clean up' urls with jquery:
.replace(/[^\w ]+/g,'') // and
.replace(/ +/g,'-')
The first one removes non alpha-numeric characters, while the second turns spaces into a dash
My question is: Is there a way to exclude a character, in my situation, # , from this first .replace() ?
Thank you.
.replace()is a standard JavaScript String method, not a jQuery thing. (I hope you don't mind, but I retagged your question accordingly.)