Because your regex just looks for <cfmail, which still occurs in the commented-out version. My guess is that it is repeated because you've run it multiple times. Try this (untested):
$outdata =~ s{(?<!<!--- )<cfmail}{<!--- <cfmail}g $outdata =~ s{</cfmail>(?! --->)}{</cfmail> --->}g;
That will only replace cfmail tags that aren't preceeded by a comment delimiter, and closing cfmail tags that aren't followed by a comment delimiter.
-b
In reply to Re: Unexpected results from a regex replacement
by bgreenlee
in thread Unexpected results from a regex replacement
by yacoubean
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |