{
  "slug": "file-search-pattern-kinds-and-default-d139180715e5",
  "title": "`file search` pattern kinds and default",
  "tools": [
    "jj"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-05-07T12:36:00.000Z",
  "announced_at": "2026-05-07T12:36:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When searching repository files, run `jj file search` with `--pattern`; an unprefixed pattern now uses regex matching. Prefix the pattern with `glob:` when you want glob matching.",
    "examples": [
      "jj file search --pattern 'regex:<regular-expression>'",
      "jj file search --pattern 'glob:<glob-pattern>' <fileset>"
    ],
    "gotchas": [
      "Version: v0.41.0",
      "--pattern <PATTERN> (required): Pattern to search for in a single line. Supports `exact:`, `glob:`, `regex:`, and `substring:`; omitted kind defaults to regex. `glob:` must match the whole line. Pattern kinds are alternatives, not mutually exclusive options.",
      "<REVSET> (`-r`, `--revision`): Revision to search; defaults to `@`.",
      "<FILESETS>: Optional file path prefixes to search instead of all files.",
      "exact:: Match strings exactly equal to the pattern.",
      "glob:: Match using Unix-style shell wildcards.",
      "regex:: Match substrings using a regular expression.",
      "substring:: Match strings containing the pattern.",
      "The `--pattern` flag accepts various pattern kinds through `kind:pattern` syntax."
    ]
  },
  "why_it_matters": "Search repository files using a glob or regular-expression pattern.",
  "before": "The `--pattern` default was `glob:`; prefix the pattern with `regex:` to use regular-expression matching.",
  "sources": [
    "https://github.com/jj-vcs/jj/releases/tag/v0.41.0",
    "https://github.com/jj-vcs/jj/blob/v0.41.0/cli/src/commands/file/search.rs",
    "https://docs.jj-vcs.dev/latest/revsets/#string-patterns"
  ],
  "rank": 0.92037,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1b-tools-20261017",
    "verdict_id": "wave1b-tools-20261017:wave1b-tools-20261017-6da253a5578c1bf6-2:gate",
    "evidence_hash": "e705ee9b9fa834ff6cba11a1155f4cc5e40b2ef96198803e26ccfaf2c23c0650"
  },
  "review": {
    "draft_hash": "606a181cefaf4ba4f7bab66b1fab52898c3bee8ce1eab309dc1e1380d2672572",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-tools-20261017:gate",
    "reason": "2 of 3 judge runs approved with p_yes >= 0.9 (mean 0.92 >= 0.9; 2 needed) and Jev gave 0.70 (>= 0.6 needed)."
  }
}
