Is there a common algorithm to cut urls from some string?
For example:
string1 = "bla bla bla http://bla.domain.com more blah blah nohttp.domain.with.no.protocol more text bla bla"
(string2, urls) = wild_magic_appears(string1)
string2 = "bla bla bla more blah blah more text bla bla"
urls = ["http://bla.domain.com", "nohttp.domain.with.no.protocol"]
I know that regex is the best solution for that, but I'm interested in non-regex solution