Hi,
I'm a beginner and trying to analyze a PCB of an purely digital extension card for an older electronic instrument from the early 2000s (containing two flash nors). There is a part of a circuit which I'm curious about what it is doing exactly and why. The context is that the mainboard, where this extension card is plugged on, can deliver either 3.3V or 5V through it's connector. It depends on which exact model the mainboard is. The 3.3V or 5V are not provided through different pins, but always through the same VCC pin which I have found out by measuring when the extension card was plugged on those different mainboards.
The circuit looks like this:

VCC (either 5V or 3.3V is coming from the connector pins at the top. It goes directly into the right pin of the SOT-23 Q2 IC or through a 220 ohm resistor to the left pin of the Q2 IC. The marking on D1 cannot be read properly. There is a bar though at side side pointing to Q2. The other end of D1 is connected to ground. I'm thinking D1 might be a 3.3V zener diode that clamps the 5V to 3.3V or otherwise let the 3.3V pass through. However, I have measured the voltage (using a 5V mainboard) and pin 1 of Q2 measured 4.2V, if this was a zener diode, I would have expected the measure about 3.3V. What I don't get is the part with Q2 and Q1. Both are marked as "DD" which doesn't help much. The Q markings may indicate a transistor or mosfet, but I'm not sure what kind of transistor circuit this would be. Typical pinouts I have found would be Pin 1 (left pin) as the base, Pin 2 (right pin) to be the emitter and Pin 3 (single pin on the other side) to be the collector. I'm puzzled though as no matter whether it is an NPN or PNP channel resistor and no matter whether it is switched, the voltage would still flow between emitter and collector as there is continuity between the right pin of Q2 to the right pin of Q1 (at the one end of R3). That would probably make the whole circuit pointless, wouldn't it? I have found that there are also sot-23 zener diodes with a DD marking, but that didn't make much sense to me either. R4 is a 470 ohm resistor connected to ground.
I would be very glad if someone with more knowledge about circuit design could give me a clue what this is doing and possibly why. Thanks a lot!