Reputation: 23161
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.
Upvotes: 1
Views: 3015