#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?<=font-family:")[^"]+"
Local $sString = "<body lang=EN-ZA style='tab-interval:36.0pt;word-wrap:break-word'>" & @CRLF & _
"<!--StartFragment--><span style='font-size:14.0pt;line-height:107%;" & @CRLF & _
"font-family:"Comic Sans MS";:"Times New Roman";" & @CRLF & _
":"Times New Roman";mso-font-kerning:0pt;mso-ligatures:none;" & @CRLF & _
"mso-ansi-language:EN-ZA;mso-fareast-language:EN-ZA;mso-bidi-language:AR-SA'>" & @CRLF & _
"Test Font 1" & @CRLF & _
" </span><span" & @CRLF & _
"style='font-size:14.0pt;line-height:107%;font-family:"Boucherie Block";" & @CRLF & _
":"Times New Roman";:"Times New Roman";" & @CRLF & _
"mso-font-kerning:0pt;mso-ligatures:none;mso-ansi-language:EN-ZA;mso-fareast-language:" & @CRLF & _
"EN-ZA;mso-bidi-language:AR-SA'>Test Font 2 </span><!--EndFragment-->" & @CRLF & _
"</body>"
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