in reply to replacing email id using regex
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: replacing email id using regex
by shmem (Chancellor) on Jan 02, 2007 at 11:06 UTC | |
by johngg (Canon) on Jan 02, 2007 at 11:20 UTC |