Replace URLs using Regex

less than 1 minute read

Replace URLs using Regex

Replacing urls with regex is very easy.

import re
text = re.sub('http://\S+|https://\S+', '', textWithURLs)

Leave a comment