I tried to use the following regular expression, which already works in C#, in C++ as well but it\'s not working in C++.
Here you go, all % in string must be compliant.
If so, match the entire string, if not, don't match
the string.
I suggest you do this with i.e. if ( regex_search( sTarget, sRx, sMatch, flags ) )
but regex_match() would do the same thing.
^(?:[^%]*%(?:\.[0-9]*)?[a-z])+[^%]*$
Expanded
^ # BOS
(?: # Cluster begin
[^%]* # Not % characters
% # % found
(?: \. [0-9]* )? # optional .###
[a-z] # single a-z required
)+ # Cluster end, 1 to many times
[^%]* # Not % characters
$ # EOS