lets say I have a string
string = "Today is going well the dog jumped over the fence. The fence was
my neighbors asdkhttps://www.urldefence.org/ult/sdfo/90nf3f/lknfksjdn?
>>>09sdkfjnkbIAS(F89kjfs and here are some more words before another link
lkm.http//www.someothersite.com/kasd09/3oif/3fo3/3/nffiosuf???
DF*SDF***8skdjnf and some more words in the end."
I want to just replace the long strings that contain the http link, defined by space before the text, and space after, with http being somewhere in the middle.
I've been trying..
re.sub('\bhttps?\b', '', string)
re.sub('https?.*?', '', string)
re.sub('https?.*?([\s+])', '', string)
having trouble connecting the dots.
re.sub(r'https?://\S*', '', string)?