#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)<a.*?data-extra-url=".*?<\/a>"
Local $sString = "<div> <br> <a data-some-id="3-6-9;id-1-2-3" data-more-id="1-3-5" data-extra-url="https://somehost.api/sub-id-1-2-3?someparam=3-6-9;id-1-2-3" href="https://somehost.api/sub-id-1-2-3?someparam=3-6-9;id-1-2-3" class="some-class">someDuplicateHere1</a></div> wysiwyg<br> <div><a class="popup-wrap-id-1-2-3" href="https://somehost.api/app/id-1-2-3?someparam=sub-id-1-2-3;sub-sub-id-1-2-3">firstImage</a></div> <br> <div>somecontent</div> <div> <span> <div><a data-some-id="456;789" href="https://somehost.api/app/id-4-5-6?someparam=sub-id-4-5-6;sub-sub-1-2-3">second</a></div> <br> </span> also some more content </div> <div> <span> <div><a data-some-id="3-6-9;id-1-2-3" data-more-id="1-3-5" data-extra-url="https://somehost.api/app/sub-id-1-2-3?someparam=3-6-9;id-1-2-3" href="https://somehost.api/app/sub-id-1-2-3?someparam=3-6-9;id-1-2-3" class="some-class">someDuplicateHere</a></div> rtf<br> </span> <br> </div> </div>"
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