Skip to content

Instantly share code, notes, and snippets.

@cxtadment
Created April 17, 2016 23:39
Show Gist options
  • Save cxtadment/e3aaaa1e5e59ba4a2ae279ca4d469ecc to your computer and use it in GitHub Desktop.
Save cxtadment/e3aaaa1e5e59ba4a2ae279ca4d469ecc to your computer and use it in GitHub Desktop.

Revisions

  1. cxtadment created this gist Apr 17, 2016.
    5 changes: 5 additions & 0 deletions removeLinks.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    def removeLink(content):
    urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', content)
    for i in range(0, len(urls)):
    content = content.replace(urls[i], '')
    return content