#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?mix)^(?!common:)(?:([^\s\n]+)\s+){2}" & @CRLF & _
"" & @CRLF & _
""
Local $sString = "common: "mortalkombat_sonia_rules_abc," player: "Mortal Kombat," 22-May-22 " & @CRLF & _
"Test1 Test2 Type1 Type2 Type3 X Y HOR1 VER1 Data1 Error1 " & @CRLF & _
"r1107 ab-1 abcr0201 222 22 -222 -22 -222 -22 2 2 Testing " & @CRLF & _
"r1106 ab-2 abcr0201 222 22 -222 -22 -222 -22 2 2 Testing " & @CRLF & _
"c377 ab-3 abcf0402 222 2 -222 -22 -222 -22 2 2 Testing " & @CRLF & _
"r632 ab-4 abcd0402 222 22 -222 -22 -222 -22 2 2 Testing"
Local $sSubst = "temp"
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