ReplaceAll[expr, rule] and ReplaceRepeated[expr, rule] search through all subexpressions of expr applying rule where they match.
Are there built-in Mathematica functions that do the same thing, except not make any replacements inside specified Heads (that is, it shouldn't look at any subexpressions within specified Head)?
I'd imagine something like ReplaceAllRestricted[expr, rule, heads] and ReplaceRepeatedRestricted[expr, rule, heads].
Developer`ReplaceAllUnheld](http://reference.wolfram.com/language/Developer/ref/ReplaceAllUnheld.html) – QuantumDot Sep 25 '16 at 21:03