use strict; use warnings; $_ = q{aaa@z.com bbb@z.com ccc@z.com}; print qq{$_\n}; s{([^@]+@)[^.]+}{${1}something}g; print qq{$_\n};
which produces
aaa@z.com bbb@z.com ccc@z.com aaa@something.com bbb@something.com ccc@something.com
Cheers,
JohnGG
Update: shmem has pointed out that I'm completely wide of the mark here and that $1 and friends are never ambiguous.
In reply to Re: replacing email id using regex
by johngg
in thread replacing email id using regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |