in reply to Re: case preservation in regexp
in thread case preservation in regexp

Parentheses matter. You didn't capture a $1.
print "<span class='topic'>$1</span>" if /\b(cat)\b/i;
If only the first letter should be flexible,
print "<span class='topic'>$1</span>" if /\b([Cc]at)\b/;

--
[ e d @ h a l l e y . c c ]