jq Regex Operations: match vs test vs scan vs capture – A Complete Guide

The match filter returns detailed match objects with offsets and captures, test returns a boolean for existence checks, scan extracts all matching strings globally, and capture returns an object of named capture groups—all implemented in src/builtin.c using the Oniguruma regex engine.

jq ships with a powerful Perl-compatible regular expression engine via Oniguruma, exposing four distinct primitives for pattern matching. Understanding the differences between match, test, scan, and capture in jq regex operations is essential for writing

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →