#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^<<<<<<< HEAD(?:(?!=======)[\s\S])*=======(?:(?!>>>>>>> \w+)[\s\S])*>>>>>>> \w+"
Local $sString = "// Somes code" & @CRLF & _
"$done['rules'] = TRUE;" & @CRLF & _
"" & @CRLF & _
"<<<<<<< HEAD" & @CRLF & _
"$conf['some_unit_id'] = '4-qw-gg-ds-sometext';" & @CRLF & _
"=======" & @CRLF & _
"// Some Snippets Site Info" & @CRLF & _
"$conf['site_info'] = array(" & @CRLF & _
" 'customer_service_phone' => '+1 323223232" & @CRLF & _
" 'logo_path' => 'https://www.google.com/img/icons/src/logo.svg'," & @CRLF & _
" 'currency' => 'CAD'," & @CRLF & _
" 'https://www.youtube.com/user/somewebsite/ogog'," & @CRLF & _
" 'https://www.instagram.com/somewebsite/'," & @CRLF & _
" )," & @CRLF & _
");" & @CRLF & _
">>>>>>> ff6df3435231fdff78fwsd83e7dffa0732eft554" & @CRLF & _
"" & @CRLF & _
"// Somes code" & @CRLF & _
"$done['rules'] = TRUE;"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
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 AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm