{
  "slug": "semgrep-metavariable-comparisons-support-case-insensitive-string-matching-b1acbe45150b",
  "title": "Semgrep metavariable comparisons support case-insensitive string matching",
  "tools": [
    "semgrep"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-02-18T00:43:14.000Z",
  "announced_at": "2026-02-18T00:43:14.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a Semgrep rule needs to compare a metavariable’s string value without case sensitivity, add a `metavariable-comparison` using `upper(str($VALUE)) == \"SEMGREP\"` (or use `lower()` for lowercase comparison).",
    "examples": [
      "- metavariable-comparison:\n    metavariable: $VALUE\n    comparison: upper(str($VALUE)) == \"SEMGREP\""
    ],
    "gotchas": [
      "Version: v1.152.0",
      "metavariable (required): The metavariable to compare; it must be bound by a positive pattern.",
      "comparison (required): A Python-like comparison expression. Docs list `str()` and comparison operators; v1.152.0 release note demonstrates `upper(str(...))` for case-insensitive matching."
    ]
  },
  "why_it_matters": "Write a Semgrep rule that compares a metavariable's string value without case sensitivity.",
  "sources": [
    "https://github.com/semgrep/semgrep/releases/tag/v1.152.0",
    "https://docs.semgrep.dev/writing-rules/rule-syntax"
  ],
  "rank": 0.97019,
  "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": "wave2b-20261017",
    "verdict_id": "wave2b-20261017:wave2b-20261017-ac3dbc1247a4c59c-5:gate",
    "evidence_hash": "24c83e185ee3150386d6cd757c00d1654e1de31009e536883fb42065159bd96b"
  },
  "review": {
    "draft_hash": "07b0a4fe6a20c3c96fda2b79e0f7705eafaf71b91e0f061a7a0de4dfdc2b69a6",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2b-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.71 (>= 0.6 needed)."
  }
}
