#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)"resource_id": "[^"]*?(?<last_word>\w+)""
Local $sString = "{"resource_id": "/subscriptions/85bbb6fe-yyyy-xxx-81a6-806aaa0ca/resourceGroups/vg-test/providers/Microsoft.Web/sites/TestAPI", "metric_name": "FSUsage", "timeStamp": "2025-12-14T14:48:00Z", "subscription_id": "85bbb6fe-yyyy-xxx-81a6-806aaa0ca", "unit": "Bytes", "namespace": "microsoft.web/sites", "resource_group": "vg-test", "average": 0}" & @CRLF & _
"" & @CRLF & _
"{"resource_id": "/subscriptions/85bbb6fe-yyyy-xxx-81a6-806aaa0ca/resourceGroups/vg-test/providers/Microsoft.Sql/servers/test-sql-01/databases/Test_Prod", "metric_name": "allocated_storage", "timeStamp": "2025-12-14T14:57:00Z", "subscription_id": "85bbb6fe-yyyy-xxx-81a6-806aaa0ca", "unit": "Bytes", "namespace": "microsoft.sql/databases", "resource_group": "vg-test", "average": 855016}"
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