How can I remove duplicate forward slashes from the a url, but keep the // which comes after http: so that the URL does not break.
http:
http://localh
You can use:
abc.replace(/([^:]\/)\/+/g, "$1");
Working Demo
Update: Already answered by Halcyon