What are you trying to achieve?
Hey, I want to strip out output from Model. It is wrapped around multiline json like: json { "something" : 123, \n "other" : "aaaa" }
I was able to strip that out with proper prompt, but still from time to time model still puts json annotation. So I decided to strip that out just on the next consuming block with following regex: {{replace(3.result; “json(.*?)
”; “$1”)}}
But it doesn’t work. Your documentation is not sufficient. It states it should be something like: {{replace(3.result; /json(.*?)
/; $1)}} but this doesn’t work either. Please help. I spent already much time on research. Whenever I find some article on that it doesn’t clearly states in what the regexp should be wrapped, and how to reference to grouping. Note that in other languages reference can be \1, not only $1, the regex can be wrapped in r" " or / /. ChatGPT suggest “json(.*)
” which doesn’t work neither.