#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?:" & @CRLF & _
" #start by finding the initial position of the table start, in order to store the match position for \G" & @CRLF & _
" TABLE\n\K|" & @CRLF & _
" #after we've found the table head, continue matching using this position. make sure we arent at the beginning of the string" & @CRLF & _
" \G(?<!^)" & @CRLF & _
")" & @CRLF & _
"#capture the data we're interested in" & @CRLF & _
"(?:" & @CRLF & _
" #make sure there is no 'END' in the string" & @CRLF & _
" (?!END)" & @CRLF & _
" #match everything until the line ending" & @CRLF & _
" ." & @CRLF & _
")*" & @CRLF & _
"#consume the newline at the end of the string" & @CRLF & _
"\n"
Local $sString = ""
Local $sSubst = "%\0"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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