re = /Link to Monitoring.*<\/a>.*<\/th><td style='padding:10px;border:1px solid;vertical-align:top;text-align:left'>([\\s\\S])<\/td>/m
str = 'Link to Monitoring</a>\\n </th><td style=\'padding:10px;border:1px solid;vertical-align:top;text-align:left\'><a rel=\'nofollow\' href=\'https://my.pingdom.com/reports/uptime#check=1615711\'>https://my.pingdom.com/reports/uptime#check=1615711</a><br/><a rel=\'nofollow\' href=\'https://my.pingdom.com/reports/uptime#check=1617633\'>https://my.pingdom.com/reports/uptime#check=1617633</a><a target=\'_blank\' href=\'\'> </a></td>
'
# 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