# A uniform rule for matching numeric and symbolic expressions for inverse of complex numbers?

I am trying to do some substitution on the basis of pattern matching. I am trying to replace $$\frac{1}{a+i b}\to\frac{a-ib}{a^2+b^2}$$ in the following way,

ruleExp = {Power[Plus[Complex[0,-1],a_],-1]->(a+I)/(a^2+1),
Power[Plus[Complex[0,1],a_],-1]->(a-I)/(a^2+1),
Power[Plus[a_,Times[Complex[0,1],b_]],-1]->(a-I b)/(a^2+ b^2),
Power[Plus[a_,Times[Complex[0,-1],b_]],-1]->(a+I b)/(a^2+ b^2)};

1/(a - I b) /. ruleExp (*Out:= (a + I b)/(a^2 + b^2)*)

1/(a + I b) /. ruleExp (*Out:= (a + I b)/(a^2 + b^2)*)

1/(a - I  ) /. ruleExp (*Out:= (a + I)/(a^2 + 1) *)

1/(a + I  ) /. ruleExp (*Out:= (a - I)/(a^2 + 1) *)


As you can see I have to write 4 rules to match patterns with symbols and different signs, as I understand it this is robust but is there some smarter way to match all such expressions for numeric as well as symbolic expressions for all signs with less than these four rules?

lst = {1/(a - I b), 1/(a + I b), 1/(a - I), 1/(a + I)}


1.

FullSimplify[ComplexExpand @ lst, ExcludedForms -> {_Complex}]


2.

rule = pat : Power[u_ + _Complex  v_., _] :>
FullSimplify[ComplexExpand[pat], ExcludedForms -> {_Complex}];

lst /. rule


3.

rule2 = Power[u_ + v_. Complex[x_, y_], p_.] :>
Power[u + v Complex[x, -y], -p]/(u^2 + v^2);

lst /. rule2