re = /href\s?=\s?"\s?([\S\s]+)"/
str = 'href="http://somedomain.com/subscription/some-report-text/issue/the-deadliest-word-on-the-
planet-could-bring-savvy-investors-extraordinary-profits/?u=000071340856&vid=TatDiU&a=MMP&o=9637385?u=000071340856&vid=8ALdFM&a=MMP&o=6530827?u=000071340856&vid=9Vm2j_&a=MMP&o=1652570?u=000071340856&vid=Cd_ME9&a=MMP&o=8995371"'
# Print the match result
str.scan(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