#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^[ \t]*[\r\n]+"
Local $sString = " P0:::inicial" & @CRLF & _
" P1:::pregunta" & @CRLF & _
" P2:::pregunta" & @CRLF & _
" P3:::pregunta" & @CRLF & _
" R1:::respuesta" & @CRLF & _
" R2:::respuesta" & @CRLF & _
" R3:::respuesta" & @CRLF & _
" R4:::respuesta" & @CRLF & _
" R5:::respuesta" & @CRLF & _
" R6:::respuesta" & @CRLF & _
" R7:::respuesta" & @CRLF & _
" R8:::respuesta" & @CRLF & _
" R9:::respuesta" & @CRLF & _
" C1:::cotizacion" & @CRLF & _
" C2:::cotizacion" & @CRLF & _
" C3:::cotizacion" & @CRLF & _
" A1:::agregar" & @CRLF & _
" A2:::agregar" & @CRLF & _
" " & @CRLF & _
" C4:::cotizacion"
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