#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?ms)(\S+) = .*VOS_Malloc\(\S+, .*\);.*memset_s\s*\([^,]*\1[^,]*, ([^,]+), [^,]+, ([^,]+)\);"
Local $sString = " pNewBuf = (CHAR *)VOS_Malloc(VASP_AAA_MID, tmp_length * xxx);" & @CRLF & _
" if (NULL == pNewBuf) {" & @CRLF & _
" (VOID)VOS_Free(tmp_buf);" & @CRLF & _
" *buf = NULL;" & @CRLF & _
" return VOS_ERR;" & @CRLF & _
" }" & @CRLF & _
" (VOID)memset_s ((CHAR *)(pNewBuf), tmp_length, 0, tmp_length);" & @CRLF & _
"" & @CRLF & _
" nRet = memcpy_s ((VOID *)(pNewBuf), (VOS_UINT32)tmp_length, (VOID *)(tmp_buf), (VOS_UINT32)tmp_offset);" & @CRLF & _
" VOS_DBGASSERT(nRet == VOS_OK);" & @CRLF & _
" (VOID)VOS_Free(tmp_buf);" & @CRLF & _
"" & @CRLF & _
" pNewBuf = (CHAR *)VOS_Malloc(VASP_AAA_MID, tmp_length * xxx);" & @CRLF & _
" if (NULL == pNewBuf) {" & @CRLF & _
" (VOID)VOS_Free(tmp_buf);" & @CRLF & _
" *buf = NULL;" & @CRLF & _
" return VOS_ERR;" & @CRLF & _
" }" & @CRLF & _
" (VOID)memset_s ((CHAR *)(pNewBuf), tmp_length * 3, 0, tmp_length);" & @CRLF & _
""
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
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