Fwd: reg expression again

2006-10-23 Thread Anshul Saxena
-- Forwarded message -- From: Anshul Saxena <[EMAIL PROTECTED]> Date: Oct 23, 2006 8:38 AM Subject: Re: reg expression again To: chen li <[EMAIL PROTECTED]> You should try : my $file_name =~ /^(OT).*(\d+$)/ The caret ^ when outside any brackets, indicates that the c

Re: reg expression again

2006-10-22 Thread chen li
--- Robin Sheat <[EMAIL PROTECTED]> wrote: > On Monday 23 October 2006 12:37, chen li wrote: > > my $file_name='OT-q1.001'; > > > > if ($file_name=~/(OT)*.(\d+$)/){ > Maybe you mean: > if ($file_name=~/^OT.*\.(\d+$)/){ > Thank you and it is what I want. Li

Re: reg expression again

2006-10-22 Thread John W. Krahn
chen li wrote: > Hi all, Hello, > I write a small script as follows: > > use strict; > use warnings; > > my $file_name='OT-q1.001'; > > if ($file_name=~/(OT)*.(\d+$)/){ > print "find it\t $file_name"; > }else {print "No math";} > > The problem is that it also macth the following > st

reg expression again

2006-10-22 Thread chen li
Hi all, I write a small script as follows: use strict; use warnings; my $file_name='OT-q1.001'; if ($file_name=~/(OT)*.(\d+$)/){ print "find it\t $file_name"; }else {print "No math";} The problem is that it also macth the following string: my $file_name='I:/Common/Notebooks/Trans10C.

Re: reg expression again

2006-10-22 Thread Robin Sheat
On Monday 23 October 2006 12:37, chen li wrote: > my $file_name='OT-q1.001'; > > if ($file_name=~/(OT)*.(\d+$)/){ Maybe you mean: if ($file_name=~/^OT.*\.(\d+$)/){ -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 595

Re: reg expression again

2006-10-22 Thread chen li
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > chen li wrote: > > Hi all, > > Hello, > > > I write a small script as follows: > > > > use strict; > > use warnings; > > > > my $file_name='OT-q1.001'; > > > > if ($file_name=~/(OT)*.(\d+$)/){ > > print "find it\t $file_name"; > > }e