frostyfan109 / tranql

A Translator Query Language
https://researchsoftwareinstitute.github.io/data-translator/apps/tranql
MIT License
0 stars 1 forks source link

Find Tool can return false positives on selectors (non-JSONPath mode) #65

Open frostyfan109 opened 5 years ago

frostyfan109 commented 5 years ago

Although not really harmful, it isn't helping. This is more relevant now that JSONPath has been added, as this will happen commonly when switching between the two modes. For example, $.nodes.* will return all nodes and links (in normal mode) because the last selector it finds is *. The problem is that it should detect the entire string as a single selector, $.nodes.*, but it continues until it matches the first it can find.

Not much can be done about this that I can think of, as the only fix that comes to mind is lookbehinds (something along the lines of (?<=^|->)), which are only supported in Chrome as of now. However, it is possible to add a more advanced regex engine as a dependency which would allow us to use these.