in reply to search and repalce excluding delimeter

If I understand you correctly, you want as result:

src/utility/include/abc.pl@@/main/f1/f2/1 %I%, %I%;123";";

right?

You can either use the matched delimiter and add that into the replacement as well:

$line =~ s!/main/.*?([,;"\s])!%I%$1!g;

(I've changed the regex delimiter to ! so I don't need to escape the slashes and put the alternation into a character class)

Or you can use a lookahead assertion:

$line =~ s!/main/.*?(?=[,;"\s]!%I%!g;