Skip to content

Instantly share code, notes, and snippets.

@marks
Created July 27, 2009 03:48
Show Gist options
  • Select an option

  • Save marks/156014 to your computer and use it in GitHub Desktop.

Select an option

Save marks/156014 to your computer and use it in GitHub Desktop.
require 'uri'
def remove_urls(text)
urls = URI.extract(text)
text.gsub(/#{urls}/, 'LINK')
end
puts remove_urls("check out my cool new video at my website at http://myspace.com/aesdf")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment