#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?si)<[\w:]+(?=(?:[^>"']|"[^"]*"|'[^']*')*?(?<=\s)href\s*=\s*(?:(['"])\s*((?:(?!\1).)*?/namehere/nane2here/(?:option1|option2)(?:(?!\1).)*)\s*\1))\s+(?:".*?"|'.*?'|[^>]*?)+>"
Local $sString = "<link rel="apple-touch-icon" href= " //bits.wikimedia.org//namehere/nane2here/option2asdf" />" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"<div>adasdsda<div>...lots of tags here... <a ... href="/name/name/option1/data1/data2"...anything here ...">src</a>...others HTML text here...<a ... href="/namehere/nane2here/option2/data1"...>" & @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