re = /([a-zA-Z0-9_-]+?)_[\d\w]{8}\-(?:[\d\w]{4}\-){3}[\d\w]{12}[_\d\w\s-]*$/
str = '/body/RenderingA_6c91dd08-c318-4aa1-9883-bd0ed8af711_UnqiueKeyA/RenderingB_1a9cbcf1-e80f-4448-a21e-12e66f38c015_UniqueKeyB/RenderingC_1a9cbcf1-e80f-4448-a21e-12e66f38c015_UniqueKeyC'
# 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