#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(^([#]+|[*-+]\.|[0-9]+\.|[ ]{3,}|[> ]+)\s([^\n]+)$|([*_~\-]+)([^\4]+?)\4|(`+)([^\n]+)?\n([^\6]+?)\6)"
Local $sString = "# 标题" & @CRLF & _
"" & @CRLF & _
" 引用" & @CRLF & _
"" & @CRLF & _
"> 缩进" & @CRLF & _
">> 多级缩进" & @CRLF & _
"> > 呵呵" & @CRLF & _
"" & @CRLF & _
"普通文本 *加粗文本* ***特别粗的文本*** ~删除~ _斜体_" & @CRLF & _
"" & @CRLF & _
"```JavaScript" & @CRLF & _
"Code" & @CRLF & _
"```" & @CRLF & _
"" & @CRLF & _
"另一个代码段" & @CRLF & _
"```" & @CRLF & _
"Code" & @CRLF & _
"```" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"## 二级标题" & @CRLF & _
"" & @CRLF & _
"1. 有序 列表一" & @CRLF & _
"2. 有序列表二" & @CRLF & _
"3. 有序列表三" & @CRLF & _
"" & @CRLF & _
"*. 无序列表一" & @CRLF & _
"*. 无序列表二"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
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