This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
 BUILT-IN MATHEMATICA SYMBOL Tutorials »| See Also »| More About »

# HoldPattern

 HoldPattern[expr]is equivalent to expr for pattern matching, but maintains expr in an unevaluated form.
• The left-hand sides of rules are usually evaluated, as are parts of the left-hand sides of assignments. You can use HoldPattern to stop any part from being evaluated.
Set up a pattern whose left-hand side is kept unevaluated:
Use the pattern:
Make a definition without the argument of being evaluated:
Log autoevaluates to Log[b]/Log[a], so there is a match:
Cases finds elements that match patt; use HoldPattern to find rules:
Set up a pattern whose left-hand side is kept unevaluated:
 Out[1]=
Use the pattern:
 Out[2]=

Make a definition without the argument of being evaluated:
 Out[2]=

Log autoevaluates to Log[b]/Log[a], so there is a match:
 Out[1]=

Cases finds elements that match patt; use HoldPattern to find rules:
 Out[1]=
New in 3