#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mxJ)(?:(?<=^\n)|(?<=\A))" & @CRLF & _
"(?<list_all>" & @CRLF & _
" (?<list_prefix>" & @CRLF & _
" [\s]{0,3}" & @CRLF & _
" (?<list_type_any>" & @CRLF & _
" (?:" & @CRLF & _
" (?<list_type_unordered_star>(?&list_unordered_star))" & @CRLF & _
" |" & @CRLF & _
" (?<list_type_unordered_minus>(?&list_unordered_minus))" & @CRLF & _
" |" & @CRLF & _
" (?<list_type_unordered_plus>(?&list_unordered_plus))" & @CRLF & _
" |" & @CRLF & _
" (?<list_type_ordered>(?&list_ordered))" & @CRLF & _
" )" & @CRLF & _
" )" & @CRLF & _
" [ \t]+" & @CRLF & _
" )" & @CRLF & _
" (?<list_content>(?s:.+?))" & @CRLF & _
" (?<list_after>" & @CRLF & _
" \z" & @CRLF & _
" |" & @CRLF & _
" \n{2,}" & @CRLF & _
" (?=\S)" & @CRLF & _
" (?!" & @CRLF & _
" [ \t]*" & @CRLF & _
" (?<list_type_any2>" & @CRLF & _
" (?:" & @CRLF & _
" (?<list_type_unordered_star2>(?&list_unordered_star))" & @CRLF & _
" |" & @CRLF & _
" (?<list_type_unordered_minus2>(?&list_unordered_minus))" & @CRLF & _
" |" & @CRLF & _
" (?<list_type_unordered_plus2>(?&list_unordered_plus))" & @CRLF & _
" |" & @CRLF & _
" (?<list_type_ordered2>(?&list_ordered))" & @CRLF & _
" )" & @CRLF & _
" )" & @CRLF & _
" [ \t]+" & @CRLF & _
" )" & @CRLF & _
" )" & @CRLF & _
")" & @CRLF & _
"(?(DEFINE)" & @CRLF & _
" (?<list_unordered_star>" & @CRLF & _
" [\*]" & @CRLF & _
" (?!" & @CRLF & _
" (?:" & @CRLF & _
" [ ]?[\*][ ]?" & @CRLF & _
" ){2,}" & @CRLF & _
" )" & @CRLF & _
" )" & @CRLF & _
" (?<list_unordered_minus>" & @CRLF & _
" [\-]" & @CRLF & _
" (?!" & @CRLF & _
" (?:" & @CRLF & _
" [ ]?[\-][ ]?" & @CRLF & _
" ){2,}" & @CRLF & _
" )" & @CRLF & _
" )" & @CRLF & _
" (?<list_unordered_plus>[\+])" & @CRLF & _
" (?<list_ordered>\d+[\.])" & @CRLF & _
")"
Local $sString = "" & @CRLF & _
"* asterisk 1" & @CRLF & _
"" & @CRLF & _
"* asterisk 2" & @CRLF & _
"" & @CRLF & _
"* asterisk 3" & @CRLF & _
"" & @CRLF & _
"* * *" & @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