I tried to use the following regular expression, which already works in C#, in C++ as well but it\'s not working in C++.
C#
C++
A simple regular expression that works with VC++ and fits your description would be
std::regex("^([^%]|%(\\.[0-9]+)?[a-zA-Z])*$", std::regex::extended)
Live demo
(Change [0-9]+ to [0-9]* if digits after %. should be optional).
[0-9]+
[0-9]*
%.