C++ 2 lines RegEx Solution Base on @angrybirdRR and @StefanPochmann's Discussion
\nclass Solution {\npublic:\n    bool isValidSerialization(string preorder) {\n        string replaced = std::regex_replace(preorder, (regex)"\\\\d+,#,#", "#");
```\nclass Solution {\npublic:\n    bool isValidSerialization(string preorder) {\n        string replaced = std::regex_replace(preorder, (regex)"\\\\d+,#,#", "#");\n        return replaced == "#" || (replaced != preorder && isValidSerialization(replaced));\n    }\n};\n```
[]