Run artifact

workspace/targets/jq/blueprint/FEATURE-Strings.md

FEATURE: String and Regular Expression Builtins

FieldValue
Version20261028 V1
DescriptionManipulate strings and evaluate jq regular expression filters.
Depends OnFEATURE-CollectionBuiltins.md
Providesjq string and regex builtins
Consumesjq collection builtins

Purpose

Provide the string and regular expression operations specified by the manual and exercised by the conformance corpus.

Behavior

Implement prefix and suffix tests and trimming, whitespace trimming, splitting and joining, indices and search, ASCII case conversion, and related string operations. Preserve Unicode codepoint indexing, embedded null characters, empty separators, stream-valued arguments, and jq error behavior.

Implement test, match, capture, scan, split, splits, sub, and gsub with the corpus-required regular expression syntax and flags. Match offsets and lengths count Unicode codepoints; unmatched captures have the specified null value and negative offset. Substitution evaluates its replacement filter against named captures and preserves multiple replacement results. Use only standard-library facilities while matching the required jq behavior.

Programmatic Acceptance

=== AC string-conformance ===
Intent: String searches, trimming, splitting, and joining execute their applicable corpus cases.
Suite: scoped
Requires: executable=python3; scope=test
Probe: --list
Probe Count: summary

import json import os import subprocess import sys

SELECT = r"^(?:split\(\"\"\)|indices\(1\)|indices\(\[1,2\]\)|indices\(\", \"\)|index\(\"!\"\)|ascii_upcase|trim, ltrim, rtrim|join\(\",\"\))$" result = subprocess.run( [sys.executable, "sources/run_conformance.py", "--select", SELECT, "--json"], capture_output=True, text=True, env={**os.environ, "JQ": os.path.abspath("jq")}, ) print(result.stdout) print(result.stderr, file=sys.stderr) report = json.loads(result.stdout) tally = report["summary"] assert sum(tally.values()) > 0, SELECT assert tally["fail"] == 0 and tally["error"] == 0, tally assert result.returncode == 0, result.returncode === END AC string-conformance ===

User Acceptance

Guardrails