thanks for this solution, it works very well in some cases.
but unfortunately this is not exactly the solution i was looking for, maybe i
stated the problem unprecise:
i'd like to single out a polynomial from an other (longer polynomial), e.g.
Expand[(x^2 + y^2)^4 + y (x^2 + y^2)+y]
yields
y+x^2 y+y^3+(x^2+y^2)^4
with the method suggested by you.
but i would like to get
(x^2+y^2) ((x^2+y^2)^3 + y) + y,
therefore in this example i'd like to single out the polynomial x^2+y^2.
is there a way to do this?
thanks, robert