re = /(.*)(?:http:\/\/thepaperwall\.com\/wallpapers\/.*\.jpg)(.*)/
str = 'test test http://thepaperwall.com/wallpapers/cityscape/small/small_642331afcd78d0840485bb352d99b289b50e8467.jpg test test '
# Print the match result
str.match(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html