Help for this page
my $counter = 0; $str =~ s/<tag1[^>]*>\s*<tag2>\s*<tag3>[^<]*\K(?=<\/endtag3>)/sprintf +" [ $c-%d]", ++$counter/egsi;