Arshad Mehmood

Search the blog

    Today I Learned

    Replace URLs using Regex

    python

    Replacing urls with regex is very easy.

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