#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)\[([^]]*)\]"
Local $sString = "[EtlRowId]" & @CRLF & _
" ,[PartitionKey]" & @CRLF & _
" ,[RowKey]" & @CRLF & _
" ,[Timestamp]" & @CRLF & _
" ,[LoadDTS]" & @CRLF & _
" ,[Microsoft_VSTS_Common_BacklogPriority]" & @CRLF & _
" ,[Microsoft_VSTS_Common_Priority]" & @CRLF & _
" ,[Microsoft_VSTS_Common_ValueArea]" & @CRLF & _
" ,[Microsoft_VSTS_Scheduling_Effort]" & @CRLF & _
" ,[System_AreaPath]" & @CRLF & _
" ,[System_BoardColumn]" & @CRLF & _
" ,[System_BoardColumnDone]" & @CRLF & _
" ,[System_ChangedBy]" & @CRLF & _
" ,[System_ChangedDate]" & @CRLF & _
" ,[System_CommentCount]" & @CRLF & _
" ,[System_CreatedBy]" & @CRLF & _
" ,[System_CreatedDate]" & @CRLF & _
" ,[System_IterationPath]" & @CRLF & _
" ,[System_Reason]" & @CRLF & _
" ,[System_State]" & @CRLF & _
" ,[System_Tags]" & @CRLF & _
" ,[System_TeamProject]" & @CRLF & _
" ,[System_Title]" & @CRLF & _
" ,[System_WorkItemType]" & @CRLF & _
" ,[TeamNowCustomerId]" & @CRLF & _
" ,[fields]" & @CRLF & _
" ,[id]" & @CRLF & _
" ,[projectId]" & @CRLF & _
" ,[projectName]" & @CRLF & _
" ,[rev]" & @CRLF & _
" ,[url]" & @CRLF & _
" ,[Microsoft_VSTS_Common_ClosedDate]" & @CRLF & _
" ,[System_AssignedTo]" & @CRLF & _
" ,[BugIterationHash]" & @CRLF & _
" ,[TeamIterationHash]" & @CRLF & _
" ,[BugHash]"
Local $sSubst = "MAX(LEN([${1}])) AS [${1}]"
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