ESP32 unable to extract string from string based on Regexp mask

You don't need third-party libraries for regular expressions, they are built into the standard library: https://godbolt.org/z/W6z9337EG

#include <regex>
#include <string>
#include <iostream>

int main() {
    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))
        for (size_t i = 0; i < match.size(); ++i) 
            std::cout << i << ": '" << match[i] << "'\n";
}

Output:

0: 'ABC3D97'

Either use another backslash to escape the backslashes in your pattern, or use a raw string literal.

std::regex rgx {"[A-Z]{3}\\d{1}[A-Z]{1}\\d{2}"};  // escape
std::regex rgx {R"([A-Z]{3}\d{1}[A-Z]{1}\d{2})"}; // raw string literal