Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Previous section-----Next section

2.3.12 Verbatim Patterns

Verbatim[expr] an expression that must be matched verbatim

Verbatim patterns.
Here the x_ in the rule matches any expression.

In[1]:=  {f[2], f[a], f[x_], f[y_]} /. f[x_] -> x^2

Out[1]=

The Verbatim tells Mathematica that only the exact expression x_ should be matched.

In[2]:=  {f[2], f[a], f[x_], f[y_]} /. f[Verbatim[x_]] -> x^2

Out[2]=


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: