I have a string that can contain multiple urls (http or https). I need a script that will completely remove all these URLs from the string and return the same string without them.
I have tried so far:
var url = "and I said http://fdsadfs.com/dasfsdadf/afsdasf.html"; var protomatch = /(https?|ftp):\/\//; // NB: not '.*' var b = url.replace(protomatch, ''); console.log(b);
but this only removes the http part and saves the link.
How to write the correct regular expression to delete everything that follows http, and also to find some links in a line?
Thank you very much!
source share