re = /Tornado Warning for\.\.\.(?:\n.*)*?\n\n/m
str = 'The National Weather Service in Milwaukee/Sullivan has issued a
* Tornado Warning for...
Northwestern Columbia County in south central Wisconsin...
Southwestern Marquette County in south central Wisconsin...
* Until 945 PM CDT.
* At 911 PM CDT, a severe thunderstorm capable of producing a tornado
was located 8 miles east of Wisconsin Dells, moving northeast at 45
mph.
HAZARD...Tornado.
SOURCE...Radar indicated rotation.
IMPACT...Flying debris will be dangerous to those caught without
shelter. Mobile homes will be damaged or destroyed.
Damage to roofs, windows, and vehicles will occur. Tree
damage is likely.
* Locations impacted include...
Packwaukee, Endeavor and Briggsville.'
# 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