#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(.*)\r?\n(.*)\r?\n(.*)(?:\r?\n|$)"
Local $sString = "1000" & @CRLF & _
"AAAAAAAAAA" & @CRLF & _
"100,000.00" & @CRLF & _
"2000" & @CRLF & _
"BBBBBBBBBB" & @CRLF & _
"200,000.00" & @CRLF & _
"3000" & @CRLF & _
"CCCCCCCCCC" & @CRLF & _
"300,000.00" & @CRLF & _
"4000" & @CRLF & _
"DDDDDDDDDD" & @CRLF & _
"400,000.00"
Local $sSubst = "$1|$2|$3\n"
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