#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?s)\/\*(?!(\<\!\[CDATA\[)|(\]\]>))(.*?)\*\/"
Local $sString = "<script type="text/javascript" src="//<?php echo SITE_CDN_STATIC_DOMAIN; ?>/src/js/lib.js?<?php echo CACHEBUST; ?>"></script>" & @CRLF & _
"<?php /*<script type="text/javascript" src="//<?php echo SITE_CDN_STATIC_DOMAIN; ?>/src/js/prod.js.php?<?php echo CACHEBUST; ?>"></script> */ ?>" & @CRLF & _
"<script type="text/javascript">" & @CRLF & _
"/*<![CDATA[*/ " & @CRLF & _
"updateBodyClassContext(); " & @CRLF & _
"cookieSetContext();" & @CRLF & _
"" & @CRLF & _
"/* Run code on page load */" & @CRLF & _
"addEvent(window, 'load', function() " & @CRLF & _
"{" & @CRLF & _
" /**" & @CRLF & _
" *" & @CRLF & _
" * Example comment inside of " & @CRLF & _
" * CDATA" & @CRLF & _
" *" & @CRLF & _
" */" & @CRLF & _
" document.getElementById('emailm').focus();" & @CRLF & _
" if (location.href.indexOf('prereg=2') > -1) document.getElementById('prereg_email').focus();" & @CRLF & _
" addEvent(document.getElementById('prereg_form'), 'submit', function(e)" & @CRLF & _
" {" & @CRLF & _
" var e = (e) ? e : window.event, " & @CRLF & _
" regex_email = /^([a-z0-9])(([-a-z0-9._])*([a-z0-9_-]))*@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+(\.([a-z0-9])([-a-z0-9-])?([a-z0-9])+)+$/i;" & @CRLF & _
" if (this.prereg_email.value == '' " & @CRLF & _
" || !regex_email.test(this.prereg_email.value))" & @CRLF & _
" {" & @CRLF & _
" this.prereg_email.focus();" & @CRLF & _
" stopEvent(e);" & @CRLF & _
" }" & @CRLF & _
" });" & @CRLF & _
"}); " & @CRLF & _
"/*]]>*/" & @CRLF & _
"</script>" & @CRLF & _
"/* another comment for good measure */" & @CRLF & _
"/*and another" & @CRLF & _
"*/" & @CRLF & _
"/*another*/"
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