#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?<=^(?:(?!\bLocation:)[\s\S])*?\bLocation:[^(]*\()[^)]+"
Local $sString = "--batchresponse_bla_bla_bla_" & @CRLF & _
"--changesetresponse__bla_bla_bla_" & @CRLF & _
"--" & @CRLF & _
"Location: https://site.ru/CRM/api/data/v9.0/gm_preorders(a341eb4e-2fdf-eb11-a30b-ac1f6b465e3b)" & @CRLF & _
"OData-EntityId: https://site.ru/CRM/api/data/v9.0/gm_preorders(a341eb4e-2fdf-eb11-a30b-ac1f6b465e3b)" & @CRLF & _
"_bla_bla_bla_" & @CRLF & _
"--changesetresponse__bla_bla_bla_Location: https://site.ru/CRM/api/data/v9.0/gm_preorders(a841eb4e-2fdf-eb11-a30b-ac1f6b465e3b)" & @CRLF & _
"OData-EntityId: https://site.ru/CRM/api/data/v9.0/gm_preorders(a841eb4e-2fdf-eb11-a30b-ac1f6b465e3b)" & @CRLF & _
"_bla_bla_bla_" & @CRLF & _
"--changesetresponse_n_bla_bla_bla_" & @CRLF & _
"Location: https://site.ru/CRM/api/data/v9.0/gm_preorders(74748d08-2ee6-eb11-a30b-ac1f6b465e3b)" & @CRLF & _
"OData-EntityId: https://site.ru/CRM/api/data/v9.0/gm_preorders(74748d08-2ee6-eb11-a30b-ac1f6b465e3b)" & @CRLF & _
"n_bla_bla_bla_" & @CRLF & _
"--changesetresponse_etc"
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