fork download
  1. import re
  2.  
  3. pattern = r"https?://\S*?(?=(?<!=)https?://|$)"
  4.  
  5. s = ("http://f...content-available-to-author-only...o.barhttps://f...content-available-to-author-only...o.bazhttp://f...content-available-to-author-only...o.bar?url=http://f...content-available-to-author-only...o.baz\n"
  6. "http://f...content-available-to-author-only...o.bar?url=http://f...content-available-to-author-only...o.baz?foo=bar&baz=quxhttp://")
  7.  
  8. matches = re.findall(pattern, s, re.MULTILINE)
  9. print(matches)
Success #stdin #stdout 0.03s 9572KB
stdin
Standard input is empty
stdout
['http://f...content-available-to-author-only...o.bar', 'https://f...content-available-to-author-only...o.baz', 'http://f...content-available-to-author-only...o.bar?url=http://f...content-available-to-author-only...o.baz', 'http://f...content-available-to-author-only...o.bar?url=http://f...content-available-to-author-only...o.baz?foo=bar&baz=qux', 'http://']