#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mx)<([^\/>]+)>((([^\<]+)|(?R))*)<\/\1>"
Local $sString = "<ul><li><span>qwe</span><b></b></li><div>sometext</div></ul><div></div>. " & @CRLF & _
"" & @CRLF & _
"<li><span>qwe</span><div>s</div></li>" & @CRLF & _
"<b></b>" & @CRLF & _
"" & @CRLF & _
"<ul><li><span>qwe</span><b></b></li><div>sometext</div></ul><div></div>. " & @CRLF & _
"some text <tag>some|another|text</tag> and anything else" & @CRLF & _
"" & @CRLF & _
"str = <<'EOT'" & @CRLF & _
"Это <!--пример текста--> с5 " & @CRLF & _
"<a href="#">какой-то</a> <br>разметкой <br /> " & @CRLF & _
"<b class="11">и</b> <amg src="1"> " & @CRLF & _
"<area>непарными</area> <strong>" & @CRLF & _
"тегами</strong> и, <!--коментами-->, " & @CRLF & _
"<ul id="w"> <li id="id" class="class">1</li></ul><div></div>. " & @CRLF & _
"<u class="ну и даже так" />" & @CRLF & _
"EOT"
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