The following is cleaner.
$line =~ s{/main/[^,;"\s]*}{%I%}g;
It's a little different, but it'll behave the same if /main/ is always followed by one of the delimiters.
In reply to Re^2: search and repalce excluding delimeter
by ikegami
in thread search and repalce excluding delimeter
by paribasu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |