in reply to case preservation in regexp

I think that was /\b[Cc]at\b/

Do it like this:

s/\b([Cc])at\b/<span class="topic">${1}at</a>

By catching the "c" (be it "C" or "c") in $1 and using it in the substitution, you're preserving it's case.

Adjust to fit your particular need :-)