As an alternative to HoldPattern[Evaluate[...] you can use PatternSequence which evaluates its argument:
{Cases[{1, a -> 2 b}, PatternSequence[a -> 2 b]],
Cases[{1, a -> 1/2 b}, PatternSequence[a -> 1/2 b]],
Cases[{1, a -> π b}, PatternSequence[a -> π b]],
Cases[{1, a -> c b}, PatternSequence[a -> c b]]}
{{a -> 2 b}, {a -> b/2}, {a -> b π}, {a -> b c}}
Alternatively, give the pattern a name:
{Cases[{1, a -> 2 b}, p : (a -> 2 b)],
Cases[{1, a -> 1/2 b}, p : (a -> 1/2 b)],
Cases[{1, a -> π b}, p : (a -> π b)],
Cases[{1, a -> c b}, p : (a -> c b)]}
{{a -> 2 b}, {a -> b/2}, {a -> b π}, {a -> b c}}
FullForm@HoldPattern[a -> 1/2 b]andFullForm@{1, a -> 1/2 b}, the rest is about reordering. – Kuba Aug 23 '18 at 08:38PatternSequencein place ofHoldPattern– kglr Aug 23 '18 at 08:59HoldPatternisHoldAll, hence does not evaluate its argument, whereasPatternSequencedoes evaluate its argument. – kglr Aug 23 '18 at 09:19HoldPattern, the headPatternSequenceshieldsRulefrom being interpreted byCases, but does not have theHoldAllattribute, allowing the pattern to evaluate first! Wondering if there are subtleties tho. – kkm -still wary of SE promises Aug 23 '18 at 09:28Cases[{1/b -> 2}, 1/b -> 2 // PatternSequence]thanCases[{1/b -> 2}, Verbatim[Rule][1/b , 2]]– Kuba Aug 23 '18 at 09:30