#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?:href=|src=|url\()(?:[\",']?)(.*image3\.png)[\",',\)]+?"
Local $sString = "<!DOCTYPE html>" & @CRLF & _
"" & @CRLF & _
"<html lang="en">" & @CRLF & _
"" & @CRLF & _
"<head>" & @CRLF & _
" <meta charset="utf-8" />" & @CRLF & _
" <title></title>" & @CRLF & _
" <meta name="description" content="" />" & @CRLF & _
" <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />" & @CRLF & _
"" & @CRLF & _
" <meta http-equiv="X-UA-Compatible" content="IE=edge">" & @CRLF & _
" <link rel="stylesheet" type="text/css" href="style.css" />" & @CRLF & _
"</head>" & @CRLF & _
"" & @CRLF & _
"<body>" & @CRLF & _
" <div class="wrapper">" & @CRLF & _
" <img src="image1.png" alt="description goes here">" & @CRLF & _
" <img src="image2.png" alt="description goes here">" & @CRLF & _
" <img src="image3.png" alt="description goes here">" & @CRLF & _
" </div>" & @CRLF & _
"" & @CRLF & _
" <p>This "image3.png" is not linked so it should be ignored</>" & @CRLF & _
" <p>This "app.js" is not linked so it should be ignored</>" & @CRLF & _
" <p>This "style.css" is not linked so it should be ignored</>" & @CRLF & _
"" & @CRLF & _
" <script src="app.js"></script>" & @CRLF & _
"</body>" & @CRLF & _
"" & @CRLF & _
"</html>" & @CRLF & _
"" & @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