\w looks for just one word-character. You need look for one or more$name=~s/(\w+)(\s+)(\w+)/$1/ig; print "$name\n";
with the fix output -
Sam+ +Adams Sam Bud+ +weiser Bud Ice+ +House Ice
cheers
SK
In reply to Re: $1 $2 Weirdness?
by sk
in thread $1 $2 Weirdness?
by apt_get
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |