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 > string: > > my $file_name='I:/Common/Notebooks/Trans10C.032'; > (ot in the Notebook) 'ot' and 'OT' are not the same string so it won't match. John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>