#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)(\[|){\n(?<tab> )"id": "[0-9]*",\n\<tab>"type": [0-9],\n\<tab>"content": "[^"]*",\n\<tab>"channel_id": "[0-9]*",\n\<tab>"author": {\n(?<dtab> )"id": "[^"]*",\n\<dtab>"username": "[^"]*",\n\<dtab>"avatar": "[^"]*",\n\<dtab>"discriminator": "([0-9]{4}|[0-9])",\n\<dtab>"public_flags": [0-9]*,\n\<dtab>"flags": [0-9]*,\n\<dtab>"banner": (null|"[0-9]*"),\n\<dtab>"accent_color": (null|"[^"]*"),\n\<dtab>"global_name": "[^"]*",\n\<dtab>"avatar_decoration_data": (null|"[^"]*"),\n\<dtab>"banner_color": (null|"[^"]*")\n\<tab>},\n\<tab>"attachments": \[[^\]]*\],\n\<tab>"embeds": \[[^\]]*],\n\<tab>"mentions": \[[^\]]*],\n\<tab>"mention_roles": \[[^\]]*\],\n\<tab>"pinned": (true:|false),\n\<tab>"mention_everyone": (true|false),\n\<tab>"tts": (true:|false),\n\<tab>"timestamp": "[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{6}\+[0-9]{2}:[0-9]{2}",\n\<tab>"edited_timestamp": (null|"[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{6}\+[0-9]{2}:[0-9]{2}"),\n\<tab>"flags": [0-9]*,\n\<tab>"components": \[[^\]]*]\n}(\]|\,|)"
Local $sString = "{" & @CRLF & _
" "id": "1145344233713188874"," & @CRLF & _
" "type": 0," & @CRLF & _
" "content": "913 - this icecream good"," & @CRLF & _
" "channel_id": "1124414874454339715"," & @CRLF & _
" "author": {" & @CRLF & _
" "id": "746383273621717104"," & @CRLF & _
" "username": "kalote."," & @CRLF & _
" "avatar": "95b9bdc7aa5784a2354e2ec5256ae736"," & @CRLF & _
" "discriminator": "0"," & @CRLF & _
" "public_flags": 128," & @CRLF & _
" "flags": 128," & @CRLF & _
" "banner": null," & @CRLF & _
" "accent_color": null," & @CRLF & _
" "global_name": "Carrot :3"," & @CRLF & _
" "avatar_decoration_data": null," & @CRLF & _
" "banner_color": null" & @CRLF & _
" }," & @CRLF & _
" "attachments": []," & @CRLF & _
" "embeds": []," & @CRLF & _
" "mentions": []," & @CRLF & _
" "mention_roles": []," & @CRLF & _
" "pinned": false," & @CRLF & _
" "mention_everyone": false," & @CRLF & _
" "tts": false," & @CRLF & _
" "timestamp": "2023-08-27T13:09:04.784000+00:00"," & @CRLF & _
" "edited_timestamp": null," & @CRLF & _
" "flags": 0," & @CRLF & _
" "components": []" & @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