#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?<=\|)(?!\s).*?(?!\s)(?=\|)"
Local $sString = "| --------- | -------- | --------- | |propped| - | -a flashlight in one hand and a large leather-bound book (A History of Magic by Bathilda Bagshot) propped open against the pillow. | |Pointless| - | -“Witch Burning in the Fourteenth Century Was Completely Pointless — discuss.”| |unscrewed| - | -Slowly and very carefully he unscrewed the ink bottle, dipped his quill into it, and began to write,| |downtrodden| - | -For years, Aunt Petunia and Uncle Vernon had hoped that if they kept Harry as downtrodden as possible, they would be able to squash the magic out of him.| |sheets,| - | -As long as he didn’t leave spots of ink on the sheets, the Dursleys need never know that he was studying magic by night.| |flinch| - | -But he hoped she’d be back soon — she was the only living creature in this house who didn’t flinch at the sight of him.|"
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