ESP32 unable to extract string from string based on Regexp mask

void setup() {
    std::string str = "The quick brown fox ABC3D97 jumps over the lazy wolf";
    std::regex rgx {R"([A-Z]{3}\d{1}[A-Z]{1}\d{2})"};
    std::smatch match;
    if (!std::regex_search(str, match, rgx))
        return; // fail, didn't match
    auto output = match[0];
    Serial.println(output);
}

It might be more efficient to start with simpler code. You should always look at the documentation and the examples: