0
$\begingroup$

This question already has an answer here:

Replace[{{x^2, Sqrt[x]}, {x + 1, x - 3}}, f_[x__] -> f, 1]

Level 1 of Replace works here as expected with output {List,List}

Replace[{{x^2, Sqrt[x]}, {x + 1, x - 3}}, f_[x__] -> f, 2]

But with level 2 I would expect something like {{Power,Power},{Plus,Plus}}. However, the output still is {List,List}. Why?

$\endgroup$

marked as duplicate by Mr.Wizard Aug 16 '17 at 1:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Use {2} instead of 2. $\endgroup$ – Carl Woll Aug 15 '17 at 23:39
  • $\begingroup$ @CarlWoll Oops, thanks! ;-) $\endgroup$ – GambitSquared Aug 15 '17 at 23:42
  • $\begingroup$ @Gambit I have marked this question as already has an answer with links pointing to two older questions. I believe you will find these informative. If you still have questions let me know. $\endgroup$ – Mr.Wizard Aug 16 '17 at 1:07