Closed
Description
For me this is actually not a bug, but a useful feature that could be more user friendly or implemented in a better way.
By reading the source code it seems that the eval function has access to the global scope when evaluating expressions in parenthesis.
For instance, if I first define a parsing function, say:
parser = function(param){console.log(param);return '1,2,3,4,5'};
I can do something like that
JSONPath({},data, '$..book[0].category[(parser\(@\))]')
Where data
is the same json as defined in the doc. Would it be possible to implement a regexp parser using this method?
I feel like regular expression is a missing feature in general and I would prefer not to use this hack.
Metadata
Metadata
Assignees
Labels
No labels