re = /^DATE:.*((?:\n(?!AREA:).*)+)/m
str = 'AREA: OMBEYI MARKET, ST. RITA RAMULA
DATE: Thursday 25.03.2021, TIME: 9.00 A.M. = 5.00 P.M.
Ombeyi Mk, Kiliti Mkt, Masogo Mkt, Miwani, Kasongo, Onyango Midika, St. Rita Ramula, Onyalo
Biro, Yawo Pri, Obino, Rutek, Keyo Pri & adjacent customers.
AREA: NYAMACHE FACTORY
DATE: Thursday 25.03.2021, TIME: 830 A.M. - 3.00 P.M.
Nyamache Fact, Suguta, Gionseri, Igare, Kionduso, Nyationgongo, Enchoro, Kebuko, Emenwa, Maji
Mazuri, Borangi & adjacent customers.
AREA: SUNEKA MARKET, RIANA MARKET
DATE: Thursday 25.03.2021, TIME: 8.00 A.M. - 3.00 P.M.
Suneka Mk, Riana Mk, Kiabusura, Gesonso, Chisaro, Sugunana, Nyamira Ndogo & adjacent
customers.
AREA: ITIATI, GITUNDUTI
DATE: Thursday 25.03.2021, TIME: 9.00 A.M. = 2.00 P.M.
General China, Gachuiro, Gathuini Pri, Itiati Campus, Kianjugum, Gikore, Kihuri TBC, Gitunduti &
adjacent customers.'
# 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