Do this:
result = re.sub(r"http\S+", "", subject)
httpmatches literal characters\S+matches all non-whitespace characters (the end of the url)- we replace with the empty string
Do this:
result = re.sub(r"http\S+", "", subject)
http matches literal characters\S+ matches all non-whitespace characters (the end of the url)