Question: Extract specific items of expression.

I 'd like to extract all items that contain "a" in an expression except "ab". What I can think of is to use the two functions select and remove to do it, but I feel a little less automated. Is there a better way?

f := a*b+a*c+a+b+c
s:=remove(has,select(has,[op(f)],a),a*b)                    

 s := [a c, a]

Please Wait...