user254875486
user254875486

Reputation: 11240

How can I match '&' with JS RegExp

I have an url-encoded url (so with & replaced to &), but I want to replace all the occurences of & back to & using javascript. Currently I'm using myStr.replace("/&/g", "&"), but that doesn't work (replaces nothing).

Thanks,

Lex

Upvotes: 1

Views: 741

Answers (1)

YOU
YOU

Reputation: 123821

myStr.replace(/&/g, "&")

Upvotes: 3

Related Questions