in reply to Editting Part of Regex

Here is another, perhaps less pretty, way to do it:
substr($string, index($string, '<tag>'), rindex($string, '</tag>')) =~ + s/\n(?!$)/<br>/g;

Update: I was using the return value of rindex as the length parameter to substr. Oops! Here is a correct, albeit even less pretty, version of the above:
substr($string, index($string, '<tag>'), rindex($string, '</tag>') - i +ndex($string, '<tag>')) =~ s/\n/<br>/g;
Yech! It gets rid of the negative look-ahead assertion (since the length is corrected), but it's ugly, and duplicates some function calls. A better version (but uses temp vars) is:
my $st = index($string, '<tag>'); my $en = rindex($string, '</tag>') - $st; substr($string, $st, $en) =~ s/\n/<br>/g;
Much better. Though I'm still not sure if it's an improvement over the other suggestions above.

--sacked