This will probably do what you are asking for:
$text =~ s[\b([Cc]at)\b][<span class="topic">$1</a>]g;
but you also probably want </span> rather than </a> as requested :)
In reply to Re: case preservation in regexp
by BrowserUk
in thread case preservation in regexp
by water
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |