Skip to content

Instantly share code, notes, and snippets.

@cupakromer
Created February 10, 2013 17:54
Show Gist options
  • Save cupakromer/4750412 to your computer and use it in GitHub Desktop.
Save cupakromer/4750412 to your computer and use it in GitHub Desktop.
Remove urls from file
def remove_urls(filename)
File.write filename, File.read(filename).gsub(/https?:\/\/[^\s'"]+/,'')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment