Try
s/(?<!_n)\@mail\.ab\.com/_n\@mail.ab.com/g;
The zero-width negative look-behind, (?<!_n) says only match if the @ sign is NOT preceded by the _n. Ie. if the address already has the '_n' it won't be modified.
In reply to Re: Substitute problem
by BrowserUk
in thread Substitute problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |