#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)("UID\s*([^\n\r]*))"
Local $sString = "{" & @CRLF & _
" "Tabelle1": [" & @CRLF & _
" {" & @CRLF & _
" "Nr.": "1"," & @CRLF & _
" "Firma": "Alba Reisen/Versicherungen/Darlehen H. Kajtazi"," & @CRLF & _
" "Rechtsform": "EIU"," & @CRLF & _
" "Sitz": "Rapperswil-Jona"," & @CRLF & _
" "Kanton": "SG"," & @CRLF & _
" "UID": "CHE‑101.868.757"" & @CRLF & _
" }," & @CRLF & _
" {" & @CRLF & _
" "Nr.": "2"," & @CRLF & _
" "Firma": "Alybaba - Schischa Laden, Aly"," & @CRLF & _
" "Rechtsform": "EIU"," & @CRLF & _
" "Sitz": "Wil (SG)"," & @CRLF & _
" "Kanton": "SG"," & @CRLF & _
" "UID": "CHE‑102.012.121"" & @CRLF & _
" }," & @CRLF & _
" {" & @CRLF & _
" "Nr.": "3"," & @CRLF & _
" "Firma": "Bluamawerkstatt zur Linde Marianne Bislin-Lieberherr"," & @CRLF & _
" "Rechtsform": "EIU"," & @CRLF & _
" "Sitz": "Pfäfers"," & @CRLF & _
" "Kanton": "SG"," & @CRLF & _
" "UID": "CHE‑217.602.289"" & @CRLF & _
" }," & @CRLF & _
" ]" & @CRLF & _
"}" & @CRLF & _
""
Local $sSubst = "$1,"X":"""
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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