I have a url in this format:
http:\/\/example.example.ru\/u82651140\/audio\/song.mp3
How can I remove the extra “\”s from the string? I have tried string.replace(“\”,””) but that does not seem to do anything. If you could give me a JavaScript regular expression that will catch this, that would also work too. I just need to be able capture this string when it is inside another string.
Try:
This will specifically match the “\/” pattern so that you don’t unintentionally remove any other backslashes that there may be in the URL (e.g. in the hash part).