re = /д(ом|\.)\s*\K\d[^,|\s|;]*/m
str = 'Большой Факельный переулок, дом 23
улица Госпитальный Вал, дом 3 строение 2
микрорайон «В», дом 26; 26 (строение 1)
Средняя Калитниковская улица, дом 9/11, строение 1
Жулебинский бульвар, дом 28 корпус 2
ш. Волоколамское, д. 14 с, стр. 1
Ружейный пер., 8'
# 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