#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)((?<=\|\s)([^|]+)(?!\|\s))"
Local $sString = "- [x] Example of a completed task." & @CRLF & _
"- [x] ! Example of a completed task." & @CRLF & _
"- [x] ? Example of a completed task." & @CRLF & _
"" & @CRLF & _
"| | Task name | Plan | Actual | File |" & @CRLF & _
"| :---- | :-------------------------------------- | :---------: | :---------: | :------------: |" & @CRLF & _
"| [x] | Task one with a reasonably long name. | 08:00-08:45 | 08:00-09:00 | [[task-one]] |" & @CRLF & _
"| [x] ! | Task two with a reasonably long name. | 09:00-09:30 | | [[task-two]] |" & @CRLF & _
"| [x] ? | Task three with a reasonably long name. | 11:00-13:00 | | [[task-three]] |" & @CRLF & _
"" & @CRLF & _
"Description:" & @CRLF & _
"$1: the left [ and the right ] brackets when the symbol x is in-between" & @CRLF & _
"$2: the symbol x in between the brackets [ and ]" & @CRLF & _
"$3: the modifier ! that follows after [x]" & @CRLF & _
"$4: the modifier ? that follows after [x]" & @CRLF & _
"$5: the text that follows [x] without a modifier, e.g., [x] This is targeted." & @CRLF & _
"$6: the text that follows [x] !" & @CRLF & _
"$7: the text that follows [x] ?" & @CRLF & _
"" & @CRLF & _
"Groups $5 to $7 should exclude the any | symbols in their captures." & @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