Skip to content

scan/2 does not appear to be defined in jq 1.6 and no sample is documented #2207

Closed
@brokenregime

Description

@brokenregime

scan(regex) works
scan(regex; flags) doesn't

Running under debian 8 (jessie) and Ubuntu focal (20.04.1) with jq-linux64 1.6:

$ echo '"#big #Big #bIg #bigs #biG"' | jq '.|scan("#big\S*")'
"#big"
"#bigs"

$ echo '"#big #Big #bIg #bigs #biG"' | jq '.|scan("#big\S*";"i")'
jq: error: scan/2 is not defined at , line 1:
.|scan("#big\S*";"i")
jq: 1 compile error

Also, the online documentation for jq 1.6 shows example only for scan(regex).

Expected to get same positive results I get from test(regex; flags).

Running jq -n 'builtins' reveals the only incidence of "scan" is "scan/1".

Thanks! Otherwise, I absolutely adore this wonderful program!

-Mike B

[edits: clarifying version of jq I'm running and added reference to 'builtins' lacking scan/2]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions