Kirk,
I guess I found part of the explanation. When I ingest DNG from any camera everything works fine. When I ingest JPG as they come out of one specific camera I run into the problem with the code replacement. When I ingest DNG from that specific camera everything works fine again.
But: even when I ingest the JPG the code replacement works in the IPTC panel but not in the rename dialogue in the ingest panel. Sorry, this observation was wrong. PM can't get the serial number out of the JPG and for that reason seemingly the code replacement does not work with JPG. (see postscriptum)
So I guess it has nothing to do with the code replacement file but with the JPG. I enclose the code replacement file nonetheless.
Best,
Pat
PS: If I ingest DNG and JPG for that specific camera together, the code replacement does not work in the ingest-rename-field for JPG and for DNG. But it works in IPTC-panel-fields for the DNG but not for the JPG.