#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?: {4}|\t)(?P<name>\*{0,2}\w+):(?P<desc>(?:\s|.*)*)"
Local $sString = " bool: True if successful, False otherwise." & @CRLF & _
"" & @CRLF & _
" The return type is optional and may be specified at the beginning of" & @CRLF & _
" the ``Returns`` section followed by a colon." & @CRLF & _
"" & @CRLF & _
" The ``Returns`` section may span multiple lines and paragraphs." & @CRLF & _
" Following lines should be indented to match the first line." & @CRLF & _
"" & @CRLF & _
" The ``Returns`` section supports any reStructuredText formatting," & @CRLF & _
" including literal blocks::" & @CRLF & _
"" & @CRLF & _
" {" & @CRLF & _
" 'param1': param1," & @CRLF & _
" 'param2': param2" & @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