import re


def strip_urls(text, replace=' '):
    """A simple preprocessing function that strips URLs from text, based on a regex."""
    # simple python regex for URLs: bit.ly/PyURLre
    url_pattern = '(https?://)?(\\w*[.]\\w+)+([/?=&]+\\w+)*'
    url_re = re.compile(url_pattern)
    stripped = re.sub(url_re, replace, text)
    return stripped