it's unclear why you'd want to remove some of the submatches from a match set and what kind of regular expression would need that. Perhaps you really needed to use a regex iterator?
Describe the problem more fully, what is the input? What is the regular expression?
I tried with this: std::unique_copy (res.begin(), res.end(), std::ostream_iterator<std::string>(std::cout,"\n"));
It prints results but still the duplicates , what I'm doing wrong?