Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
brokenregime opened this issue Nov 12, 2020 · 2 comments
Closed

Comments

@brokenregime
Copy link

brokenregime commented Nov 12, 2020

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]

@itchyny
Copy link
Contributor

itchyny commented Nov 13, 2020

This is resolved by #1961.

@brokenregime
Copy link
Author

All well and good, but commit b41acdd to #1961 says:

This commit does not belong to any branch on this repository.

and scan/2 is still not implemented in jq-1.6-137-gd18b2d0-dirty, pulled and built today, 1.5 years after it was supposedly resolved, the basis for closing my report #2207.

Thanks,
-Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants