while ($content =~m/(CALCON((?!CALCON).)*)/smg){ my $entire_match = $1;