{"record":{"id":"34cb8b3c9e344bd3","repo":"podman-container-tools/podman","slug":"matchobj-0-does-not-match-pod-in-either-sid","errorCode":null,"errorMessage":"'{matchobj[0]}' does not match 'pod' in either side","messagePattern":"'(.+?)' does not match 'pod' in either side","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"hack/markdown-preprocess","lineNumber":264,"sourceCode":"            lhs = lhs[2:]\n            rhs = rhs[:len(rhs)-2]\n\n            # Check both sides for 'pod' followed by (non-\"m\" or end-of-string).\n            # The non-m prevents us from triggering on 'podman', which could\n            # conceivably be present in both sides. And we check for 'pod',\n            # not 'container', because it's possible to have something like\n            # <<container in pod|container>>.\n            if re.match('.*pod([^m]|$)', lhs, re.IGNORECASE):\n                if re.match('.*pod([^m]|$)', rhs, re.IGNORECASE):\n                    raise Exception(f\"'{matchobj[0]}' matches 'pod' in both left and right sides\")\n                # Only left-hand side has \"pod\"\n                if self.pod_or_container == 'pod':\n                    return lhs\n                return rhs\n\n            # 'pod' not in lhs, must be in rhs\n            if not re.match('.*pod([^m]|$)', rhs, re.IGNORECASE):\n                raise Exception(f\"'{matchobj[0]}' does not match 'pod' in either side\")\n            if self.pod_or_container == 'pod':\n                return rhs\n            return lhs\n\n        return re.sub(r'<<[^\\|>]*\\|[^\\|>]*>>', replwith, line)\n\n\ndef main():\n    \"script entry point\"\n    script_dir = os.path.abspath(os.path.dirname(__file__))\n    man_dir = os.path.join(script_dir,\"../docs/source/markdown\")\n\n    try:\n        os.chdir(man_dir)\n    except FileNotFoundError as ex:\n        raise Exception(\"Please invoke me from the base repo dir\") from ex\n\n    # No longer possible to invoke us with args: reject any such invocation","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/podman-container-tools/podman/blob/a2409076ef2fef60ad9ac046375dedc7d9410ef4/hack/markdown-preprocess#L246-L282","documentation":"Raised by replace_type()'s replwith() callback when neither side of a '<<lhs|rhs>>' token matches '.*pod([^m]|$)' case-insensitively. Every <<a|b>> token is required to disambiguate a pod-specific vs container-specific phrasing; 'pod' must appear in exactly one half. Typos like 'podd', 'Pod.' (actually 'Pod.' matches: d follows), 'containr pod' — the real non-matches are sides where 'pod' is absent or only occurs inside the word 'podman'.","triggerScenarios":"An options/*.md line contains '<<foo|bar>>' with no 'pod' substring outside 'podman' in either half — e.g. '<<list the pods|>>' style mistakes aside, typically '<<--podman-opt|--podman-option>>' (only 'podman' present) or a token written purely for emphasis. Errors surface wrapped in the 'Error while processing ... line' wrapper from process().","commonSituations":"Authors using <<a|b>> as a generic alternation/emphasis marker instead of the pod-vs-container switch; both sides written with 'podman' prefixed wording; leftover experimental tokens in shared option files.","solutions":["Restructure so one half contains 'pod' (not as part of 'podman'): '<<pod foo|container foo>>'","If no pod/container distinction is intended, remove the << >> and write plain text"],"exampleFix":"# before\n<<run in the sandbox|run in the sandbox>>\n\n# after\nrun in the sandbox","handlingStrategy":"validation","validationCode":"import re, pathlib, sys\npat = re.compile(r'<<[^|>]*\\|[^|>]*>>')\npod = re.compile(r'.*pod([^m]|$)', re.IGNORECASE)\nbad = []\nfor p in pathlib.Path('docs/source/markdown/options').glob('*.md'):\n    for line_no, line in enumerate(p.read_text().splitlines(), 1):\n        for tok in pat.findall(line):\n            lhs, rhs = tok[2:-2].split('|')\n            if not pod.match(lhs) and not pod.match(rhs):\n                bad.append(f'{p}:{line_no}: pod in neither side: {tok}')\nif bad:\n    sys.exit('\\n'.join(bad))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never use <<a|b>> as a generic alternation marker; the preprocessor assigns it one meaning only","When both variants read the same, write the literal text without << >>","Remember 'podman' does not count as containing 'pod' — if both halves only mention podman, restructure"],"tags":["markdown","docs","preprocessor","man-pages"],"backgroundTag":null,"analyzedSha":"a2409076ef2fef60ad9ac046375dedc7d9410ef4","analyzedAt":"2026-08-15T15:57:05.625Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}