re = /MIT-[\d\.\/\-]*/m
str = ' 2312312321312312 asadas-dasdasdads.ru MIT-1.3.2/14-29
23123123 asadewrewras-deewrewrasdasdads.ru MIT-1.4.1/13-29
2312312321312312 asadas-dasdasdads.ru MIT-1.3.2/2-29
232222 aFEWFWewsadas-dasdasdads.ru MIT-1.3.4/12-30
99999 aFEWFWewrrwerweadas-dasdasdads.ru MIT-1.4.1/4-6 #1'
# 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