#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mxi)(?:^[ \t]*(?P<complete>x))|" & @CRLF & _
"(?P<priority>\(\w+\))|" & @CRLF & _
"(?:(?P<CoDate>\d{4}-\d\d-\d\d)[ \t]*(?P<CrDate>\d{4}-\d\d-\d\d)?)|" & @CRLF & _
"(?P<task>[\w']+(?:[.,; \t-]+[\w']+)*\b(?!:))|" & @CRLF & _
"(?P<Project>\+\w+)|" & @CRLF & _
"(?P<context>@\w+)|" & @CRLF & _
"(?P<meta>[a-zA-Z]+:[\w-]*)"
Local $sString = "(A) Thank Mom for the meatballs @phone" & @CRLF & _
"(B) Schedule Goodwill pickup +GarageSale @phone" & @CRLF & _
"Post signs around the neighborhood +GarageSale" & @CRLF & _
"@GroceryStore Eskimo pies" & @CRLF & _
"" & @CRLF & _
"Really gotta call Mom (A) @phone @someday" & @CRLF & _
"(b) Get back to the boss" & @CRLF & _
"(B) Submit TPS report" & @CRLF & _
"" & @CRLF & _
"x 2011-03-03 Call Mom due:2010-01-02 again:thisOne" & @CRLF & _
"" & @CRLF & _
"x 2011-03-02 2011-03-01 Review Tim's pull request +TodoTxtTouch @github" & @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