re = /(?ms)Initiating task ContentDownload\s\w+\s\w+\s(?P<Deployment>ScopeId.*)\sfor.*\}\s*(?P<Status>.*)/m
str = 'Initiating task ContentDownload for CI ScopeId_B4419992-1C14-4FC6-AB4E-D7730CD14853/DeploymentType_4a3a8593-e333-4bb4-a3f9-bb1ce19cf0eb.6 (BlueDom - User Interactive) for target: , consumer: {719C1F1E-63E2-46C6-9469-E38B881EEA5A}
Unable to get locations, no need to continue with download'
# 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