in reply to Re: $1 $2 Weirdness?
in thread $1 $2 Weirdness?
What you more likely want is:I don't think so. yet more cargo cult regexing, huh? *sigh*$name=~s/(\w*?)(\s).*/$1/eig;
Let's strike all the unnecessary cruft.
Granted, the modifiers you inherited from the OP, but for the rest I see very little excuse.
IMO this is what the OP is after:
or even$name=~s/(\w+)(\s)(\w+)/$1/g;
though it would likely also do what he wants without the /g.$name=~s/(\w+)\s\w+/$1/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: $1 $2 Weirdness?
by GrandFather (Saint) on Jun 27, 2005 at 20:33 UTC |