#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "if \(([^\$]+\$\<\>[^ ]+)[^\}]+\(null, ([^;]+)\);\s+}\s+([^;]+)\1(.*;)"
Local $sString = "get" & @CRLF & _
"{" & @CRLF & _
"int num;" & @CRLF & _
"lock (this.queueLock)" & @CRLF & _
"{" & @CRLF & _
"if (Journal.CS$<>9__CachedAnonymousMethodDelegate7 == null)" & @CRLF & _
"{" & @CRLF & _
"Journal.CS$<>9__CachedAnonymousMethodDelegate7 = new Func<ApiBlob, int>(null, (ApiBlob blob) => Encoding.UTF8.GetByteCount(blob.DataString));" & @CRLF & _
"}" & @CRLF & _
"num = this.Sum<ApiBlob>(Journal.CS$<>9__CachedAnonymousMethodDelegate7);" & @CRLF & _
"}" & @CRLF & _
"return num;" & @CRLF & _
"}" & @CRLF & _
"}"
Local $sSubst = "\3\2\4"
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