re = /href="(.+)">(C#: парсинг HTML кода страницы)</
str = '
<a class="question-hyperlink" href="/questions/412931/c-%d0%bf%d0%b0%d1%80%d1%81%d0%b8%d0%bd%d0%b3-html-%d0%ba%d0%be%d0%b4%d0%b0-%d1%81%d1%82%d1%80%d0%b0%d0%bd%d0%b8%d1%86%d1%8b">другая ссылка</a>
<a class="question-hyperlink" href="http://ru.stackoverflow.com/questions/412931/c-%D0%BF%D0%B0%D1%80%D1%81%D0%B8%D0%BD%D0%B3-html-%D0%BA%D0%BE%D0%B4%D0%B0-%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D1%8B">C#: парсинг HTML кода страницы</a>
<a class="question-hyperlink" href="/questions/412931/c-%d0%bf%d0%b0%d1%80%d1%81%d0%b8%d0%bd%d0%b3-html-%d0%ba%d0%be%d0%b4%d0%b0-%d1%81%d1%82%d1%80%d0%b0%d0%bd%d0%b8%d1%86%d1%8b">C#: парсинг HTML кода страницы</a>
<a class="question-hyperlink" href="/questions/412931/c-%d0%bf%d0%b0%d1%80%d1%81%d0%b8%d0%bd%d0%b3-html-%d0%ba%d0%be%d0%b4%d0%b0-%d1%81%d1%82%d1%80%d0%b0%d0%bd%d0%b8%d1%86%d1%8b">другая ссылка</a>
<a class="question-hyperlink" href="/questions/412931/c-%d0%bf%d0%b0%d1%80%d1%81%d0%b8%d0%bd%d0%b3-html-%d0%ba%d0%be%d0%b4%d0%b0-%d1%81%d1%82%d1%80%d0%b0%d0%bd%d0%b8%d1%86%d1%8b">другая ссылка</a>'
# 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