#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?m)(?<type>@param) *\K(?<scalar>(?![\$])\S+)? *\K(?<var>\$\S+) *\K(?<message>\S+.*\S+)"
Local $sString = "--- Copyright @fmargerit ---" & @CRLF & _
"" & @CRLF & _
"/**" & @CRLF & _
" * First variation with scalar type" & @CRLF & _
" *" & @CRLF & _
" * @param Int $a First parameter to add" & @CRLF & _
" * @param Int $b Second parameter to add " & @CRLF & _
" *" & @CRLF & _
" */" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"/**" & @CRLF & _
" * second variation without scalar type" & @CRLF & _
" *" & @CRLF & _
" * @param $a first text " & @CRLF & _
" * @param $b second text" & @CRLF & _
" * @param $c third text" & @CRLF & _
" * " & @CRLF & _
" */" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"/**" & @CRLF & _
" * Invalid case without message" & @CRLF & _
" *" & @CRLF & _
" * @param Int $a " & @CRLF & _
" *" & @CRLF & _
" */" & @CRLF & _
"" & @CRLF & _
"/**" & @CRLF & _
" * Invalid case : without variable" & @CRLF & _
" *" & @CRLF & _
" * @param Int coucou" & @CRLF & _
" *" & @CRLF & _
" */"
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