#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "\s*([\w ]+):\s*(\[((?>[^[\]]+|(?2))*)\])"
Local $sString = "BotInfo[-]: Source IP:[10.1.1.100] Target Host:[CentOS70-1] Target OS:[CentOS 7.0] Description:[HTTP Connection Request] Details:[10.1.1.101 - - [28/May /2013:12:24:08 +0000] "GET /math/html.mli HTTP/1.0" 404 3567 "-" "-" ] Phase: [Access] Service:[WEB]" & @CRLF & _
"" & @CRLF & _
"Target Os:[Centos]"
Local $sSubst = "Field: \1 Value: \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