#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^.*?:\d\d.*?\n+|^\n+$|^.*?replies.*?\n+|^.*?\d\n+|^.*?:\n+|^Last reply.*?\n+"
Local $sString = "I recommend XMind 8 and not the newer XMind Zen (I have not tried XMind 2021). It is available here: xmind.net/download/xmind8 (edited) " & @CRLF & _
":heavy_plus_sign:" & @CRLF & _
"1" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"5 replies" & @CRLF & _
"Last reply 24 hours agoView thread" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Paul Holland 1:49 AM" & @CRLF & _
"If you need to convert to a PDF - you do not need to pay for the Pro version. On a Mac just print to a PDF. On a Windows machine use an app that lets you print to a PDF." & @CRLF & _
":point_up_2:" & @CRLF & _
"1" & @CRLF & _
"" & @CRLF & _
""
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