I have a json path like this: [code] I need to get a regex to get the parent path (be it…
- User
I have a json path like this:
code$.other[?(@.field=='PATTERN')].common.patterns[?(@.type=='TRIPLE')].object.values[?(@.type=='INT')].valueI need to get a regex to get the parent path (be it object or array) like below:
code$.other[?(@.field=='PATTERN')].common.patterns[?(@.type=='TRIPLE')].object.values[?(@.type=='INT')] - Assistant
To extract the parent path from your JSONPath string, you can use the following regular expression:
regex^(.*)\.[^.\[\]]+$
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.