the following code:

     1 #!/usr/bin/perl -w                 
     2
     3 $_ = " x11x  x22x a ";     
     4 
     5 #with '.*?'                                        
     6 $re1 = qr/x.*?\d\dx|a/;    
     7 $re2 = qr/($re1\s)?$re1/;   
     8 ($f) = /($re2)/;                           
     9 print "f:$f\n";                            
    10
    11 #with '.{1,4}'                             
    12 $re1 = qr/x.{1,4}\d\dx|a/;  
    13 $re2 = qr/($re1\s)?$re1/;   
    14 ($f) = /($re2)/;                           
    15 print "f:$f\n";                            

produces:

         f:x11x  x22x a
         f:x  x22x a
         
shouldn't the second section produce ''x11x'? (the difference between the two 
sections is in lines 6/12.)

thanks,

tom arnall


    







-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to