You write std::regex that works the first try? Well, I am not nearly as good as you, and I find it helpful to iterate my patterns until I get it right:
// compile with `g++ -std=c++20 -o regex-sandbox regex-sandbox.cpp`
#include <iostream>
#include <regex>