#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)<a\s+href="https?:\/\/?(?:www\.)?((?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+[A-Za-z]{2,8})(?:"|\/).*?>(?:https?:\/\/)?(?:www\.)?\1"
Local $sString = "<span style="color:rgb(128,0,0);font-weight:bold">> Оформлен заказ в магазине <a href="http://www.test1.com" target="_blank">test1.com</a> </spant-family:arial,sans-serif>" & @CRLF & _
"<a href="http://test.site.com/11222/sdf.html">http://www.test.site.com</a><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.8px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.8px">SOME MESSAGE TEXT</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.8px"><a href="http://www.test2.com/">www.test2.com/123/test</a>" & @CRLF & _
"SOME TEXT</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.8px"><a href="http://www.TEsst.com/">https://tesst.com</a><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.8px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.8px"> === =size:12.8px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12.8px"><a href="http://site.org">site.org</a>" & @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