When you search for a string like \(a\)xxx\(b\)yy\(c\) is there some way to create a replacement string where each group can be replaced separately?

If that is not possible the only way I see round it will be to replace better off replacing the whole line with a string splicing the replacements where the groups are.