#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?ms)^\s*\/\*.*?\*\/"
Local $sString = "/**" & @CRLF & _
" * base comment" & @CRLF & _
" * (c) SOMEBODY SOMETIME" & @CRLF & _
" * something" & @CRLF & _
" */" & @CRLF & _
"" & @CRLF & _
"///<!-- ------metadata-XML------- -->" & @CRLF & _
"/// <module type="javascript"> A" & @CRLF & _
"///<desc> some desc " & @CRLF & _
"/// </desc> " & @CRLF & _
"(function( a /* param A */) { // programmers comment ... enclosure" & @CRLF & _
"/*! user doc" & @CRLF & _
" this module ...." & @CRLF & _
" * reguired" & @CRLF & _
"....." & @CRLF & _
"*/" & @CRLF & _
"var b={}; // programmers in line comment" & @CRLF & _
"// single line comments" & @CRLF & _
"" & @CRLF & _
"// The cookie spec says up to 4k per cookie, so at ~50 bytes per entry" & @CRLF & _
"// that gives a maximum of around 80 items as a max value for this field" & @CRLF & _
" b.a=a;" & @CRLF & _
" var str = " tttt //this is not comment ! tttt "" & @CRLF & _
" var str2 = " tttt /* this is not comment too ! \" & @CRLF & _
".............. */ ttt ";" & @CRLF & _
" global.b = b; " & @CRLF & _
"}(global);" & @CRLF & _
"///</module>"
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