Question: I want to use jq to check if a keyword exists as a key in a JSON at any level. Here is what I came up with:

```
jq -c 'paths | select(.[-1]) as $p| index("headline") //empty' news.json

```

The output is an array:

```
[
  6,
  7,
  9
]

```

I want to map the output array to jq function `any()` and get an overall result as true if key exists or false if it doesn't.

How can I get that done with jq ?

Answer: 
Bash's `=~` is using extended RE.

```
[Bash-5.2] % check() { local s='(ge-0\.0\.3.*){2,}'; [[ "$1" =~ $s ]] && echo yes || echo no; }
[Bash-5.2] % check 'xxx'
no
[Bash-5.2] % check 'ge-0.0.3'
no
[Bash-5.2] % check 'ge-0.0.3 ge-0.0.3 '
yes
[Bash-5.2] % check 'ge-0.0.3 ge-0.0.3 ge-0.0.3 '
yes

```
Assuming you want to do a literal string match on whole words, not substrings, then this might be what you want:

```
$ if (( $(grep -oFw 'ge-0.0.3' <<<"$br_name" | wc -l) > 1 )); then echo 'yes'; else echo 'no'; fi
yes

```