Re: Pattern matches only when named
- To: mathgroup at smc.vnet.net
- Subject: [mg43900] Re: Pattern matches only when named
- From: "wouter meeussen" <wouter.meeussen at pandora.be>
- Date: Fri, 10 Oct 2003 03:06:21 -0400 (EDT)
- References: <bm2ugv$6so$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
FullForm[ _ + _ -> h] Rule[Times[2, Blank[]], h] (* both blanks need be equal *) FullForm[ u_ + _ -> h] Rule[Plus[Blank[], Pattern[u, Blank[]]], h] (* both can be different, or not *) Wouter. "Ken Morgan" <kemorgan at vt.edu> wrote in message news:bm2ugv$6so$1 at smc.vnet.net... > Just a curiosity: > > In[1]:= f + g /. u_ + _ -> h > Out[1]:= h > > but > > In[2]:= f + g /. _ + _ -> h > Out[2]:= f + g > > Why does the pattern match only when one of the Blanks has a name? > > > Thanks, > Ken >