1 Feb
2007
1 Feb
'07
11:25 a.m.
Dear Charlls, On Wed, 31 Jan 2007, Charlls Quarra wrote:
symbol x("x"); ex foo = A*pow(x,2) + B*x; lst ocurrences; foo.find( wild(1)*x , ocurrences ); //the wildcard replacement is B
how would you retrieve the wildcard replacement in this case?
In this simple case I would simply divide a list element by x ;-). In general it is a bit more difficult, but you could use cout << "list of wild(1)-replacements:" << endl; for (int i=0; i<ocurrences.nops(); ++i) { lst repls; ocurrences.op(i).match(wild(1)*x, repls); cout << wild(1).subs(repls, subs_options::no_pattern) << endl; } Best wishes, Chris