in reply to Re: replacing email id using regex
in thread replacing email id using regex

No, $1something isn't ambiguous, $<digit> variables never are:

$ perl -le '$_ = "aaa\@z.com bbb\@z.com ccc\@z.com"; s/(.+?\@)(.+?\.)( +.+?)/$1something.$3/g;print' aaa@something.com bbb@something.com ccc@something.com

In fact, a variable $1something is illegal:

$ perl -e '$1something' Bareword found where operator expected at -e line 1, near "$1something +" (Missing operator before something?) syntax error at -e line 1, next token ??? Execution of -e aborted due to compilation errors.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^3: replacing email id using regex
by johngg (Canon) on Jan 02, 2007 at 11:20 UTC
    I didn't know that, thank you. You learn something new literally every day in the Monastery.

    Cheers,

    JohnGG