#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?im)^\s*[\r\n]"
Local $sString = "# H1" & @CRLF & _
" ## H2" & @CRLF & _
"### H3" & @CRLF & _
"" & @CRLF & _
"# A First Level Header" & @CRLF & _
"" & @CRLF & _
"## Second Level Header" & @CRLF & _
"" & @CRLF & _
"Now is the time for all good men to come to the aid of their country. This is just a regular paragraph." & @CRLF & _
"" & @CRLF & _
"The quick brown fox jumped over the lazy dog's back." & @CRLF & _
"" & @CRLF & _
"*The* quick brown fox jumped over the lazy dog's back." & @CRLF & _
"" & @CRLF & _
"**The** quick brown fox jumped over the lazy dog's back." & @CRLF & _
"" & @CRLF & _
"`The` quick brown fox jumped over the lazy dog's back." & @CRLF & _
"" & @CRLF & _
"[The]() quick brown fox jumped over the lazy dog's back." & @CRLF & _
"" & @CRLF & _
"### Header 3" & @CRLF & _
"" & @CRLF & _
"> This is a blockquote." & @CRLF & _
"> " & @CRLF & _
"> This is the second paragraph in the blockquote." & @CRLF & _
">" & @CRLF & _
"> ## This is an H2 in a blockquote"
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