#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(\/\/<!-)([^\/]*(?:\/(?!\/!>)[^\/]*)*)(\/\/!>)"
Local $sString = "//<!- directiveDecoratorComment" & @CRLF & _
" (function directiveDecorator() {" & @CRLF & _
" if (typeof(angular) == 'undefined') return;" & @CRLF & _
" var appElement = document.querySelector('[ng-app]');" & @CRLF & _
" var appName = appElement.getAttribute('ng-app');" & @CRLF & _
" if (typeof(appName) == 'undefined') return;" & @CRLF & _
" var app = angular.module(appName);" & @CRLF & _
" angular.forEach(app._invokeQueue, function(value, key) {" & @CRLF & _
" if (value[1] == 'directive') {" & @CRLF & _
" var directiveName = value[2][0];" & @CRLF & _
" app.config(function($provide) {" & @CRLF & _
" $provide.decorator(directiveName + 'Directive', function($delegate) {" & @CRLF & _
" var directive = $delegate[0];" & @CRLF & _
" console.log("Decorating:",directiveName,'on',appName,'template now ==',"/views/" + directive.templateUrl);" & @CRLF & _
" directive.templateUrl = "/views/" + directive.templateUrl;" & @CRLF & _
" return $delegate;" & @CRLF & _
" });" & @CRLF & _
" });" & @CRLF & _
" }" & @CRLF & _
" });" & @CRLF & _
" }());" & @CRLF & _
"" & @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