Mentions légales du service

Skip to content
Snippets Groups Projects
Commit dbbd94d5 authored by Adam Powers's avatar Adam Powers
Browse files

Fixes s3u/JSONPath#49 - parsing error when bracket paths contain dot

Added six new tests for various path formats:
$.store.book[*].author
$['store']['book'][*]['author']
$[store][book][*][author]
$.store.book[*]['author']
$['store']['book'][*]['application/vnd.wordperfect']
$.store.book[*]['vnd.wordperfect']

Prior to fixing a regular expression in the _normalize() function, the
last two tests would fail due to the '.' in the bracket path
'vnd.wordperfect'. This is fixed by adding a negative forward
lookahead (?![^\[]*\]) to the regular expression identifying '.'. The
new negative forward lookahead assumes that any '.' before a '[' is
okay, but any '.' before a ']' must be inside a bracket set and should
be ignored.
parent 97dea483
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment