navigaid
1/22/2017 - 5:18 PM

Set up a pattern whose left-hand side is kept unevaluated:

Set up a pattern whose left-hand side is kept unevaluated:

In[1]:= a + b /. _ + _ -> 0

Out[1]= a + b

In[3]:= FullForm[_ + _ -> 0]

Out[3]= Rule[Times[2,Blank[]],0]

In[2]:= a + b /. HoldPattern[_ + _] -> 0

Out[2]= 0