On Mon, 29 Mar 2004 12:14:49 -0600 James Edward Gray II <[EMAIL PROTECTED]> wrote:
> On Mar 29, 2004, at 11:02 AM, Smoot Carl-Mitchell wrote: > > > On Mon, 29 Mar 2004 15:05:34 +0530 > > "MuthuKumar" <[EMAIL PROTECTED]> wrote: > > > >> $name =~ s/\W.*//; #change 1 > > > > This RE deletes zero or more non-alphanumeric characters followed by > > anything. > > > > So it deletes the entire string, since there was no match on a > > non-alphanumeric character. > > Half-right. ;) It deletes nothing, since there was no match... Oops. You are correct. '\W' matches exactly once. I was thinking '\W*'. -- Smoot Carl-Mitchell Systems/Network Architect email: [EMAIL PROTECTED] cell: +1 602 421 9005 home: +1 480 922 7313 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>