re = /_([0-9]*)/m
str = 'https://tn.com.ar/politica/la-iglesia-convoco-para-el-8-de-marzo-una-misa-contra-la-despenalizacion-del-aborto_1032027fd
https://tn.com.ar/politica/la-iglesia-convoco-para-el-8-de-marzo-una-misa-contra-la-despenalizacion-del-aborto_32027fd
https://tn.com.ar/politica/la-iglesia-convoco-para-el-8-de-marzo-una-misa-contra-la-despenalizacion-del-aborto_11032027fd'
# 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