I have a list of replacement rules like
list˘of˘replacement˘rules = {a -> 1, b -> 2, c -> 3}
and I want to filter all the elements where ‘b’ is replaced by using Cases[] and a search pattern.
The following code does not work:
Cases[list˘of˘replacement˘rules, b -> _]
The result is {}.
How should the pattern be defined in order to get the result {b->2}?
Cases[{a -> 1, b -> 2, c -> 3}, HoldPattern[Rule[b, _]]]
$\endgroup$