#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^.*added:[\s\S]*?(?=^[^+-])"
Local $sString = "demo, demo-setga, Deployment (apps) has changed:" & @CRLF & _
"..." & @CRLF & _
"- image: "imagedemo43"" & @CRLF & _
"+ image: "imagedemo44"" & @CRLF & _
"..." & @CRLF & _
"demo, demo-app1, Deployment (apps) has been removed:" & @CRLF & _
"- # Source: /charts/app1/templates/deploy.yaml" & @CRLF & _
"- apiVersion: apps/v1" & @CRLF & _
"- imagePullSecrets:" & @CRLF & _
"- - name: demo-registry" & @CRLF & _
"+" & @CRLF & _
"demo, demo-app2, Deployment (apps) has changed:" & @CRLF & _
"..." & @CRLF & _
"- value: 4.2.0" & @CRLF & _
"+ value: 4.3.0" & @CRLF & _
"..." & @CRLF & _
"demo, demo-app4, Deployment (apps) has been added:" & @CRLF & _
"-" & @CRLF & _
"+ apiVersion: apps/v1" & @CRLF & _
"+ kind: Deployment" & @CRLF & _
"+ metadata:" & @CRLF & _
"+ heritage: Helm" & @CRLF & _
"+ imagePullSecrets:" & @CRLF & _
"+ - name: demo-registry" & @CRLF & _
"demo, demo-app9, Deployment (apps) has changed:" & @CRLF & _
"..." & @CRLF & _
"- value: 2.2.0" & @CRLF & _
"+ value: 4.3.0" & @CRLF & _
"..." & @CRLF & _
"demo, demo-app5, PodDisruptionBudget (policy) has been added:" & @CRLF & _
"-" & @CRLF & _
"+ apiVersion: policy/v1beta1" & @CRLF & _
"+ kind: PodDisruptionBudget" & @CRLF & _
"+ metadata:" & @CRLF & _
"+ app: app5" & @CRLF & _
"+ release: demo" & @CRLF & _
"../helm_var/test/dev/secrets.yaml.dec" & @CRLF & _
"demo, demo-app8, PodDisruptionBudget (policy) has been added:" & @CRLF & _
"-" & @CRLF & _
"+ # Source: test/charts/app5/templates/pdb.yaml" & @CRLF & _
"+ apiVersion: policy/v1beta1" & @CRLF & _
"+ matchLabels:" & @CRLF & _
"+ app: app5" & @CRLF & _
"+ release: demo" & @CRLF & _
"demo, demo-app9, Deployment (apps) has changed:" & @CRLF & _
"..." & @CRLF & _
"- value: 4.1.0" & @CRLF & _
"+ value: 9.3.0" & @CRLF & _
"..."
Local $sSubst = ""
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