re = /en\/(?:(?!history).)*?\//m
str = 'https://denissov.ru/en/barracuda_limited/
https://denissov.ru/en/barracuda_chronograph/
https://denissov.ru/en/barracuda_mechanical/
https://denissov.ru/en/speedster/
https://denissov.ru/en/free_rider/
https://denissov.ru/en/nau_automatic/
https://denissov.ru/en/lady_flower/
https://denissov.ru/en/enigma/
https://denissov.ru/en/number_one/
https://denissov.ru/en/history/
https://denissov.ru/en/wordhistory/
https://denissov.ru/en/historyword/
https://denissov.ru/en/histor_y/
https://denissov.ru/en/barracuda_limited/\', \'_top\')" style="cursor: pointer;"'
# 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