re = /^<{7} HEAD(?:\r?\n(?!={7}\r?\n).*)*\r?\n={7}(?:\r?\n(?!>{7} ).*)*\r?\n>{7} [a-z0-9]+/m
str = '<<<<<<< HEAD
$conf[\'some_unit_id\'] = \'4-qw-gg-ds-sometext\';
=======
// Some Snippets Site Info
$conf[\'site_info\'] = array(
\'customer_service_phone\' => \'+1 323223232
\'logo_path\' => \'https://www.google.com/img/icons/src/logo.svg\',
\'currency\' => \'CAD\',
\'https://www.youtube.com/user/somewebsite/ogog\',
\'https://www.instagram.com/somewebsite/\',
),
);
>>>>>>> ff6df3435231fdff78fwsd83e7dffa0732eft554
// Somes code
$done[\'rules\'] = TRUE;'
# 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