# Indicate level with Replace [duplicate]

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?

• Use {2} instead of 2. – Carl Woll Aug 15 '17 at 23:39
• @CarlWoll Oops, thanks! ;-) – GambitSquared Aug 15 '17 at 23:42
• @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. – Mr.Wizard Aug 16 '17 at 1:07