re = /\p{L}/m
str = 'Ørestads Boulevard 2B
Sankt Annæ Plads 32 5
Syriensvej 24 6 st th
Ørestads Boulevard 33
Sankt Annæ Plads 33
Øresundsvej 2B
Øresundsvej 2923B
Øresundsvej 292 st th, Amager
Øresundsvej 292334B'
# 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