#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^.*(Set Cookie:|Set-Cookie:|HTTP|200 OK|Cookie:|document\.?cookie).*$"
Local $sString = "svc_test" & @CRLF & _
"adm_test" & @CRLF & _
"eac_test" & @CRLF & _
"passaccount" & @CRLF & _
"pass_fail" & @CRLF & _
"pa_ssfail" & @CRLF & _
"Set Cookie:" & @CRLF & _
"Set-Cookie: <cookie-name>=<cookie-value>" & @CRLF & _
"HTTP/2.0 200 OK" & @CRLF & _
"document.cookie" & @CRLF & _
"//ES5" & @CRLF & _
"" & @CRLF & _
"if (document.cookie.split(';').some(function(item) {" & @CRLF & _
" return item.trim().indexOf('reader=') == 0" & @CRLF & _
"})) {" & @CRLF & _
" console.log('The cookie "reader" exists (ES5)')" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"//ES2016" & @CRLF & _
"" & @CRLF & _
"if (document.cookie.split(';').some((item) => item.trim().startsWith('reader='))) {" & @CRLF & _
" console.log('The cookie "reader" exists (ES6)')" & @CRLF & _
"}" & @CRLF & _
""
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