Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Patterns' topicStudent Support Forum > General > "Patterns"

Next Comment >Help | Reply To Topic
Author Comment/Response
Matt
06/01/13 07:02am

In[1]:= {1, 2} /. _ -> q

Out[1]= q

In[2]:= {1, 2} /. {_} -> q

Out[2]= {1, 2}

In[3]:= {1, 2} /. {_,_} -> q

Out[3]= q


Why is In[2] not matching the whole expression?

Thanks,

--matt

URL: ,

Subject (listing for 'Patterns')
Author Date Posted
Patterns Matt 06/01/13 07:02am
Re: Patterns jf 06/01/13 6:17pm
Next Comment >Help | Reply To Topic