#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mx)(?(DEFINE)" & @CRLF & _
" (?<void>br|img|area|base|col|command|embed|hr|input|keygen|link|meta|param|source|track|wbr|!DOCTYPE)" & @CRLF & _
" (?<any>[^<>]*+)" & @CRLF & _
")" & @CRLF & _
"" & @CRLF & _
"<div \s class="card">" & @CRLF & _
"(?P<pair> (?&any)" & @CRLF & _
" (:?" & @CRLF & _
" <(?P<v_tag>(?!\/)(?&void))(?&any)> (?:(?&pair) | (?&any))*+ (<\/(?P=v_tag)>)? |" & @CRLF & _
" <(?P<tag>(?!\/)[^<> ]++)(?&any)> (?:(?&pair) | (?&any))*+ <\/(?P=tag)>" & @CRLF & _
" ) (?&any)" & @CRLF & _
")*" & @CRLF & _
"<\/div>"
Local $sString = "<!DOCTYPE html>" & @CRLF & _
"<html>" & @CRLF & _
" <head>" & @CRLF & _
" <title>Example</title>" & @CRLF & _
" </head>" & @CRLF & _
" <body>" & @CRLF & _
" <div class="card-container">" & @CRLF & _
" <div class="card">" & @CRLF & _
" <h5>First MD Card</h5>" & @CRLF & _
" <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(34).jpg" alt="Card image cap">" & @CRLF & _
" <p>" & @CRLF & _
" Lorem ipsum dolor sit amet consectetur adipisicing elit. Sapiente" & @CRLF & _
" fugiat accusamus excepturi rem temporibus nobis natus." & @CRLF & _
" </p>" & @CRLF & _
" </div>" & @CRLF & _
" <div class="slider">" & @CRLF & _
" <ul class="progress-bar">" & @CRLF & _
" <li class="active"></li>" & @CRLF & _
" <li></li>" & @CRLF & _
" <li></li>" & @CRLF & _
" </ul>" & @CRLF & _
" </div>" & @CRLF & _
" </div>" & @CRLF & _
" </body>" & @CRLF & _
"</html>" & @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