A Ruby Regex for Removing Links and Images from Text
r = /https?:\/\/[\S]+/i you_string.gsub(r, '')
Here's the rubular regex to play around with yourself http://rubular.com/r/SRKkYrW4IJ
r = /https?:\/\/[\S]+/i you_string.gsub(r, '')
Here's the rubular regex to play around with yourself http://rubular.com/r/SRKkYrW4IJ
Comments