#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)((\/\/[^\n\r]*)|(\/\*[^\*\/]*\*\/))"
Local $sString = "/* asdadasd" & @CRLF & _
"addds" & @CRLF & _
"asdasdas */" & @CRLF & _
"" & @CRLF & _
"// asdasdasdasdasdas" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"/* asdasdasd */" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"asdasdasda" & @CRLF & _
"asdas" & @CRLF & _
"das" & @CRLF & _
"das" & @CRLF & _
"das" & @CRLF & _
"da" & @CRLF & _
"int counter = 0;" & @CRLF & _
"string line;" & @CRLF & _
"" & @CRLF & _
"// Read the file and display it line by line." & @CRLF & _
"System.IO.StreamReader file = " & @CRLF & _
" new System.IO.StreamReader("c:\\test.txt");" & @CRLF & _
"while((line = file.ReadLine()) != null)" & @CRLF & _
"{" & @CRLF & _
" Console.WriteLine (line);" & @CRLF & _
" counter++;" & @CRLF & _
"}" & @CRLF & _
"" & @CRLF & _
"file.Close();" & @CRLF & _
"" & @CRLF & _
"// Suspend the screen." & @CRLF & _
"Console.ReadLine();"
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