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

> Master jq regex operations match test scan and capture with this guide Explore detailed match objects boolean checks global extraction and named captures to efficiently process your JSON data

- Repository: [jqlang/jq](https://github.com/jqlang/jq)
- Tags: deep-dive
- Published: 2026-04-11

---

**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`](https://github.com/jqlang/jq/blob/main/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