Hi Alexander,
The regex works when grouped, ({[\w\W]+?})
but if you are going to do that and there is only going to be one match then a named group (?<json>{[\w\W]+?})
is probably a cleaner option. I have attached a recording showing the behavior.
You may already be doing it, but just incase you aren’t you can also prompt ChatGPT for specific output, in the recording I have added a second prompt to define how I want my response, the regex will still be the same in such scenarios but ChatGPT can produce structured data only if prompted so, but you may want to set out instructions for when it can’t fulfil a request too.