#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?sm)<script>.*(adsConfig).*<\/script>"
Local $sString = "<script>" & @CRLF & _
" var middleCount = 0;" & @CRLF & _
" var = {" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
" nonLinear: {" & @CRLF & _
" url: "https://8245.digital/vpaid/?id=7875&type=nonlinear&dcc=1"," & @CRLF & _
" total: 0 ," & @CRLF & _
" offset: 10 * 60," & @CRLF & _
" label: { name: 'label', val: 'overlay', counter: true }" & @CRLF & _
" }," & @CRLF & _
" " & @CRLF & _
" pre: {" & @CRLF & _
" maxImpressions: 2 ," & @CRLF & _
" urls: ["https://8245.digital/vpaid/?id=5241&label=preroll&dcc=1&maximp=2&synconly=1"]" & @CRLF & _
"" & @CRLF & _
" }," & @CRLF & _
" " & @CRLF & _
" middle: {" & @CRLF & _
" pop: true," & @CRLF & _
" maxTotalImp: 0 ," & @CRLF & _
" maxImpressions: 1," & @CRLF & _
" urls: ["https://8245.digital/vpaid/?id=21515&synconly=1&maximp=1&dcc=1&mid=6","https://8245.digital/vpaid/?id=5242&synconly=1&maximp=1&dcc=1&mid=6"]" & @CRLF & _
"," & @CRLF & _
" getUrls: function () {" & @CRLF & _
" var u = middleCount && .middle.urls" & @CRLF & _
" ? .middle.urls.slice(1)" & @CRLF & _
" : .middle.urls;" & @CRLF & _
" middleCount++;" & @CRLF & _
" return u;" & @CRLF & _
" }," & @CRLF & _
" " & @CRLF & _
" label: { name: 'label', val: 'middleroll', counter: true }" & @CRLF & _
" }," & @CRLF & _
" " & @CRLF & _
" confirmTimeout: 60 * 1000," & @CRLF & _
" confirmOn: ['localhost', 'zombie-film.net']," & @CRLF & _
" vast: {timeouts: {loading: 20000, starting: 20000, global: 120000}}," & @CRLF & _
" volume: 0.3," & @CRLF & _
" tv: true," & @CRLF & _
" suppressOnFakeFullScreen: true" & @CRLF & _
" };" & @CRLF & _
" </script>"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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