Selecting round parentheses arguments
- To: mathgroup at smc.vnet.net
 - Subject: [mg118028] Selecting round parentheses arguments
 - From: JJ <wateronwildfire at gmail.com>
 - Date: Sat, 9 Apr 2011 07:12:31 -0400 (EDT)
 
Hello again everybody,
Chelly question made me think to something. Suppose I have a list like this:
p={a b (c 3 d)+a c (b^2 5),b (c+d 4)-a,-(a^3 d) c}
in which the round parentheses (except for the middle one) are unnecessary
but play a semantic role by dividing some expressions from others with
different meaning. Now let's say I want to extract the expressions inside
those parentheses and obtain
ans={{c 3 d,b^2 5},c+d 4, a^3 d}
Is there a quick way to do that?
thanks