#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?s)(?<=<a)(.+)\s?href\s*=\s*("|')(.+?)(\2)"
Local $sString = "<!DOCTYPE html>" & @CRLF & _
"<html>" & @CRLF & _
"<head>" & @CRLF & _
"<title>Hyperlinks</title>" & @CRLF & _
"<link href="theme.css" rel="stylesheet" />" & @CRLF & _
"</head>" & @CRLF & _
"<body>" & @CRLF & _
"<ul><li><a href="/" id="home">Home</a></li><li><a" & @CRLF & _
"" & @CRLF & _
"class="selected" href="/courses">Courses</a>" & @CRLF & _
"</li><li><a href =" & @CRLF & _
"'/forum' >Forum</a></li><li><a class="href"" & @CRLF & _
"onclick="go()" href= "#">Forum</a></li>" & @CRLF & _
"<li><a id="js" href =" & @CRLF & _
""javascript:alert('hi yo')" class="new">click</a></li>" & @CRLF & _
"<li><a id='nakov' href =" & @CRLF & _
"http://www.nakov.com class='new'>nak</a></li></ul>" & @CRLF & _
"a href="#empty"></a>" & @CRLF & _
"<a id="href">href='fake'<img src='http://abv.bg/i.gif'" & @CRLF & _
"alt='abv'/></a><a href="#"><a href='hello'></a>" & @CRLF & _
"<!-- This code is commented:" & @CRLF & _
"<a href="#commented">commentex hyperlink</a> -->" & @CRLF & _
"</body>" & @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