in reply to Editting Part of Regex
$string =~ s{<tag>(.*?)</tag>} {(my $x = $1) =~ s/\n/<br>/g; "<tag>$x</tag>"}gise; [download]