#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^(.*?)\.((?:\.?[0-9]+){3,}(?:[-a-z]+)?)\.nupkg$"
Local $sString = "knockoutjs.3.4.2.nupkg" & @CRLF & _
"log4net.2.0.8.nupkg" & @CRLF & _
"runtime.tizen.4.0.0-armel.microsoft.netcore.jit.2.0.0.nupkg" & @CRLF & _
"nuget.core.2.7.0-alpha.nupkg" & @CRLF & _
"microsoft.identitymodel.6.1.7600.16394.nupkg" & @CRLF & _
"" & @CRLF & _
"Package: knockoutjs Version: 3.4.2" & @CRLF & _
"Package: log4net Version: 2.0.8" & @CRLF & _
"Package: runtime.tizen.4.0.0-armel.microsoft.netcore.jit Version: 2.0.0" & @CRLF & _
"Package: nuget.core Version: 2.7.0-alpha" & @CRLF & _
"Package: microsoft.identitymodel Version: 6.1.7600.16394" & @CRLF & _
""
Local $sSubst = "Package: \1 Version: \2"
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