September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,3 @@
# startswith/1 is boolean:
"abc" | startswith("ab")
#=> true

View file

@ -0,0 +1,6 @@
# index/1 returns the index or null,
# so the jq test "if index(_) then ...." can be used
# without any type conversion.
"abcd" | index( "bc")
#=> 1

View file

@ -0,0 +1,3 @@
# endswith/1 is also boolean:
"abc" | endswith("bc")
#=> true

View file

@ -0,0 +1,5 @@
"abc" | test( "^ab")
"abcd" | test("bc")
"abcd" | test("cd$")

View file

@ -0,0 +1,6 @@
# In jq 1.4 or later:
jq -n '"abcdabcd" | indices("bc")'
[
1,
5
]

View file

@ -0,0 +1,3 @@
$ jq -n '"abcdabcd" | match("bc"; "g") | .offset'
1
5