#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?<=\"id\"\:)\d+(?=\,)"
Local $sString = "{" & @CRLF & _
" "id": 5987431," & @CRLF & _
" "remoteRef": "f150edeab22e5458a8d5db64280023f0"," & @CRLF & _
" "paymentEntityType": "Bank"," & @CRLF & _
" "accountHolder": "Svilen Varbanov"," & @CRLF & _
" "accountNumber": "********6691"," & @CRLF & _
" "expiresEnd": null," & @CRLF & _
" "paymentEntityStatus": "Unverified"," & @CRLF & _
" "token": null," & @CRLF & _
" "canDeposit": false," & @CRLF & _
" "canWithdraw": false," & @CRLF & _
" "lastUsed": false," & @CRLF & _
" "cardType": null," & @CRLF & _
" "logs": [" & @CRLF & _
" {" & @CRLF & _
" "paymentEntityStatus": "Unverified"," & @CRLF & _
" "message": "Bank payment entity has been created."," & @CRLF & _
" "updated": "2019-10-01 11:49:22Z"" & @CRLF & _
" }" & @CRLF & _
" ]," & @CRLF & _
" "transactionSummaries": null," & @CRLF & _
" "paymentGateway": "RBC"," & @CRLF & _
" "details": {" & @CRLF & _
" "bankName": null," & @CRLF & _
" "sortCode": null," & @CRLF & _
" "swiftCode": null," & @CRLF & _
" "branchCode": null," & @CRLF & _
" "branchAddress": null," & @CRLF & _
" "transitNumber": "340"," & @CRLF & _
" "institutionNumber": "34103"," & @CRLF & _
" "accountId": "575876691"" & @CRLF & _
" }," & @CRLF & _
" "createdAt": "2019-10-01T11:49:22.4680708Z"" & @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