#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "var .*?Scope.*?=[\s\S]*?{([\s\S]*?)};[\s\S]*?var .*?Directive.*?=[\s\S]*?{([\s\S]*?)};[\s\S]*?encModule.directive\(['"](.*?)['"][\s\S]*"
Local $sString = "//------------------------------------------------------------------" & @CRLF & _
"// PrivacyAgreementDialogDirective.js" & @CRLF & _
"// Copyright 2013 AppliedMinds, Inc." & @CRLF & _
"//------------------------------------------------------------------" & @CRLF & _
"" & @CRLF & _
""use strict";" & @CRLF & _
"" & @CRLF & _
"//------------------------------------------------------------------" & @CRLF & _
"// Map of attributes to be copied into the scope." & @CRLF & _
"var privacyAgreementDialogScope =" & @CRLF & _
"{" & @CRLF & _
"};" & @CRLF & _
"" & @CRLF & _
"//------------------------------------------------------------------" & @CRLF & _
"// Configuration of the privacyAgreementDialog directive." & @CRLF & _
"var privacyAgreementDialogDirective =" & @CRLF & _
"{" & @CRLF & _
" 'restrict' : 'E'," & @CRLF & _
" 'transclude' : true," & @CRLF & _
" 'scope' : privacyAgreementDialogScope," & @CRLF & _
" 'controller' : 'PrivacyAgreementDialogCtrl'," & @CRLF & _
" 'templateUrl' : 'encirca/common/privacyAgreementDialog/PrivacyAgreementDialog.html'," & @CRLF & _
" 'replace' : true" & @CRLF & _
"};" & @CRLF & _
"" & @CRLF & _
"//------------------------------------------------------------------" & @CRLF & _
"// Create the directive." & @CRLF & _
"encModule.directive('privacyAgreementDialog'," & @CRLF & _
" enc.func.returns(privacyAgreementDialogDirective));" & @CRLF & _
""
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