lib/jsonpath.rb in jsonpath-0.5.1 vs lib/jsonpath.rb in jsonpath-0.5.2
- old
+ new
@@ -18,10 +18,10 @@
while not scanner.eos?
if token = scanner.scan(/\$/)
@path << token
elsif token = scanner.scan(/@/)
@path << token
- elsif token = scanner.scan(/[a-zA-Z0-9_]+/)
+ elsif token = scanner.scan(/[a-zA-Z0-9_-]+/)
@path << "['#{token}']"
elsif token = scanner.scan(/'(.*?)'/)
@path << "[#{token}]"
elsif token = scanner.scan(/\[/)
count = 1