re = /Your Updated Reservation Confirmation (?:#\s?)?\d+ at .+/
str = 'Your Updated Reservation Confirmation # 68876759 at Holiday Inn Express.
Your Updated Reservation Confirmation at Holiday Inn Hotel & Suites - Confirmation # 64754230
Your Updated Reservation Confirmation at Crowne Plaza - Confirmation # 68003047'
# Print the match result
str.match(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