#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^>\s+(\S+(?:\s\S+)*)"
Local $sString = "> this is a quote that" & @CRLF & _
"runs" & @CRLF & _
"for multiple" & @CRLF & _
"lines" & @CRLF & _
"" & @CRLF & _
"but you need the pattern to stop matching when the quote" & @CRLF & _
"is finished. Perhaps force your pattern to stop matching when it encounters 2 consecutive whitespace characters." & @CRLF & _
"" & @CRLF & _
"> Quote before a double space!" & @CRLF & _
"" & @CRLF & _
"The ^ in the pattern says that that quotes will only be recognized if the > is at the start of the a line. e.g. This > is not a quote, it is being used as a greater sign." & @CRLF & _
"" & @CRLF & _
"> End with a quote"
Local $sSubst = "<blockquote><h3>Quote</h3><p>$1</p></blockquote>"
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