RE: simple regular expression problem

2004-10-20 Thread Steve Bertrand
> Steve Bertrand wrote: > ... >> while ($buf = ) { >> # $buf now contains line of file, one per each loop of while >> $buf =~ /(\w+)/; >> $userName = $1; >> ...do something with $userName >> } > > This is a common error. You should not use $1 without making sure the > regex > did in

RE: simple regular expression problem

2004-10-20 Thread Bob Showalter
Steve Bertrand wrote: ... > while ($buf = ) { > # $buf now contains line of file, one per each loop of while > $buf =~ /(\w+)/; > $userName = $1; > ...do something with $userName > } This is a common error. You should not use $1 without making sure the regex did in fact match. Othe

RE: simple regular expression problem

2004-10-20 Thread Steve Bertrand
alter [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 19, 2004 8:57 AM > To: 'Khairul Azmi'; [EMAIL PROTECTED] > Subject: RE: simple regular expression problem > > Khairul Azmi wrote: >> Hi all, >> I am a newbie. I just need to extract the string containing

RE: simple regular expression problem

2004-10-20 Thread Steve Bertrand
'@', returning 'user' (w/o quotes). Read: perldoc perlop perldoc perlretut perldoc perlre I HTH, and I surely hope that I've been reasonably accurate with my assessment. Steve > > Thanks > > AD > > -Original Message----- > From: Bob Showalt

RE: simple regular expression problem

2004-10-20 Thread adisegna
D] Subject: RE: simple regular expression problem Khairul Azmi wrote: > Hi all, > I am a newbie. I just need to extract the string containing the unix > account from the following text > > <[EMAIL PROTECTED]> SIZE=1024. I'm guessing you want to extract the string &q

RE: simple regular expression problem

2004-10-19 Thread Bob Showalter
Khairul Azmi wrote: > Hi all, > I am a newbie. I just need to extract the string containing the unix > account from the following text > > <[EMAIL PROTECTED]> SIZE=1024. I'm guessing you want to extract the string "user"? (But how do you know that that corresponds to a Unix account?) The followi

Re: simple regular expression problem

2004-10-19 Thread Gunnar Hjalmarsson
Khairul Azmi wrote: I just need to extract the string containing the unix account from the following text <[EMAIL PROTECTED]> SIZE=1024. Can anyone tell me how to do it in perl? Try the docs. perldoc perlrequick perldoc perlretut perldoc perlre Thanks in advance. You're welcome. -- Gunn

simple regular expression problem

2004-10-19 Thread Khairul Azmi
Hi all, I am a newbie. I just need to extract the string containing the unix account from the following text <[EMAIL PROTECTED]> SIZE=1024. Can anyone tell me how to do it in perl? Thanks in advance. Azmi -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT