import re
regex = re.compile(r"http(s)?(\s+)", flags=re.MULTILINE)
test_str = (" because she s the worst \n"
" i am referring to this http iimgurcom5srylmijpg does it have any deeper meaning or does it signify anything i just do nt get it why she d do that \n"
" cheating but zoldycks must have a great time at thanksgiving \n"
" kurosaki ichigo http images5fanpopcomimagephotos29000000ichigowallpaperkurosakiichigo290694271024768jpg and kurosaki mea http staticzerochannetkurosakimeafull1689483jpg \n"
" there are a shit ton of koutarous but the presence of one https smediacacheak0pinimgcomoriginals1219ed1219ed717fc2bfce372759bba2fe1cfegif is enough to make it the most interesting party.")
subst = ""
result = regex.sub(subst, test_str)
if result:
print(result)
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html