#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)clientField\(([a-zA-Z]+)\)(?:\["?([\w]+)"?\]|(\.json\(\)))?"
Local $sString = "{" & @CRLF & _
" "name": "openid_connect"," & @CRLF & _
" "label": "SSO"," & @CRLF & _
" "args": {" & @CRLF & _
" "name": "openid_connect"," & @CRLF & _
" "scope": [" & @CRLF & _
" "Gitalab"" & @CRLF & _
" ]," & @CRLF & _
" "response_type": "code"," & @CRLF & _
" "client_auth_method": "query"," & @CRLF & _
" "discovery": true," & @CRLF & _
" "client_id": "clientField(clientId)"," & @CRLF & _
" "client_secret": "clientField(secret)"," & @CRLF & _
" "client_auth_method": "query"," & @CRLF & _
" "redirect_uri": clientField(redirectUris).json()," & @CRLF & _
" "redirect_uri": clientField(redirectUris)[0]," & @CRLF & _
" "redirect_uri": clientField(redirectUris)["test"]," & @CRLF & _
" "client_auth_method": "query"" & @CRLF & _
" }" & @CRLF & _
"}"
Local $sSubst = "!!!!!"
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