#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "{\s*([\s\S]*?)\s*}"
Local $sString = "<!DOCTYPE html>" & @CRLF & _
"<html>" & @CRLF & _
" <body>" & @CRLF & _
" <button id="btn-get">$.get()</button>" & @CRLF & _
" <script data-require="jquery" data-semver="2.0.3" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>" & @CRLF & _
" <script type="text/javascript" charset="utf-8"> " & @CRLF & _
" function getValue(element)" & @CRLF & _
" {" & @CRLF & _
" alert(element);" & @CRLF & _
" //end" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" var content, matched;" & @CRLF & _
" $('#btn-get').click(function(e) " & @CRLF & _
" {" & @CRLF & _
" $.get('abc.html', function(data) " & @CRLF & _
" {" & @CRLF & _
" content = data;" & @CRLF & _
" });" & @CRLF & _
" matched = String(content).match("getValue(.*)end"); " & @CRLF & _
" console.log(matched);" & @CRLF & _
" });" & @CRLF & _
" </script>" & @CRLF & _
" </body>" & @CRLF & _
"</html>" & @CRLF & _
""
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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