#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "\r?\n(?!\r?\n)"
Local $sString = "Lorem ipsum dolor sit amet, consectetur adipiscing elit" & @CRLF & _
" sed do eiusmod tempor incididunt ut labore et dolore magna" & @CRLF & _
"aliqua. Ut enim ad minim veniam, quis nostrud exercitation " & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"ullamco laboris nisi ut aliquip ex ea " & @CRLF & _
"commodo consequat. Duis aute irure dolor " & @CRLF & _
"in reprehenderit in voluptate velit esse " & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"cillum dolore eu fugiat nulla pariatur. " & @CRLF & _
"Excepteur sint occaecat cupidatat"
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