You can extract URLs from a block of text with a single regular expression.
(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+This pattern matches HTTP, HTTPS, and FTP links. Here’s a Python script that uses it to pull URLs out of text:
text = "<CONTAINING URLS>"
urls = re.findall('(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+', text)
print(urls)