#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?mi)^.*?(IDC\w*)[\s\S]*?(?:$|(,\n.*$))(\n|$)"
Local $sString = " LTEXT "Width",IDC_WIDTH_TEXT,203,74,22,10" & @CRLF & _
" EDITTEXT IDC_WIDTH_IN,244,73,57,12,ES_AUTOHSCROLL | WS_GROUP" & @CRLF & _
" CONTROL "Manually scale instances and paper",IDC_RAD_PSCALE_KEYIN," & @CRLF & _
" "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,15,89,132,10" & @CRLF & _
" CONTROL "Keep drawing instance scale 1.0",IDC_RAD_PSCALE_AUTO," & @CRLF & _
" "Button",BS_AUTORADIOBUTTON,15,104,123,10" & @CRLF & _
" CONTROL "Keep drawing paper scale 1.0",IDC_RAD_ISCALE_AUTO," & @CRLF & _
" "Button",BS_AUTORADIOBUTTON,15,119,118,10"
Local $sSubst = "$1\n"
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