Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,3 +1,23 @@
|
|||
# startswith/1 is boolean:
|
||||
"abc" | startswith("ab")
|
||||
#=> true
|
||||
|
||||
# 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
|
||||
|
||||
# endswith/1 is also boolean:
|
||||
|
||||
"abc" | endswith("bc")
|
||||
#=> true
|
||||
|
||||
# Using the regex functions available in jq 1.5:
|
||||
|
||||
"abc" | test( "^ab")
|
||||
|
||||
"abcd" | test("bc")
|
||||
|
||||
"abcd" | test("cd$")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
# index/1 returns the index or null,
|
||||
# so the jq test "if index(_) then ...." can be used
|
||||
# without any type conversion.
|
||||
# In jq 1.4 or later:
|
||||
jq -n '"abcdabcd" | indices("bc")'
|
||||
[
|
||||
1,
|
||||
5
|
||||
]
|
||||
|
||||
"abcd" | index( "bc")
|
||||
#=> 1
|
||||
# In jq 1.5, the regex function match/1 can also be used:
|
||||
$ jq -n '"abcdabcd" | match("bc"; "g") | .offset'
|
||||
1
|
||||
5
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
# endswith/1 is also boolean:
|
||||
"abc" | endswith("bc")
|
||||
#=> true
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
"abc" | test( "^ab")
|
||||
|
||||
"abcd" | test("bc")
|
||||
|
||||
"abcd" | test("cd$")
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# In jq 1.4 or later:
|
||||
jq -n '"abcdabcd" | indices("bc")'
|
||||
[
|
||||
1,
|
||||
5
|
||||
]
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
$ jq -n '"abcdabcd" | match("bc"; "g") | .offset'
|
||||
1
|
||||
5
|
||||
Loading…
Add table
Add a link
Reference in a new issue