Re: Problem with matching.
- To: mathgroup at smc.vnet.net
- Subject: [mg53959] Re: Problem with matching.
- From: p-valko at tamu.edu
- Date: Sat, 5 Feb 2005 03:15:30 -0500 (EST)
- References: <ctrngb$brk$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On a second thought: I think the first responses (inclding mine) did not capture the problem. The real problem is that your original matching pattern is so generally stated that it would match anything so Mathematica prevents it to do so. I think in this case you must require F to have 3 arguments, whatever they are. In other words you should write: /. F[{c1_, a_, c2_}]F[{c3_, a_, c4_}] Indeed, with this construction F[{x, 1, c}]F[{x, 2, f}] /. F[{c1_, a_, c2_}]F[{c3_, a_, c4_}] :> yes does not do the substitution and F[{x, 2, c}]F[{x, 2, f}] /. F[{c1_, a_, c2_}]F[{c3_, a_, c4_}] :> yes does do the substitution - and hence results is yes, as expected. Regards Peter