Filip Jursik wrote:
> Hi,

Hello,

> this
> 
> $text = "first first second third";
> $text =~ /(first.*?third)/;
> print $1;
> 
> gives me
> 
> "first first second third"
> 
> as a result instead of expected
> 
> "first second third"
> 
> What am I doing wrong? I've expected the .*? to limit the wildcard only
> to the string " second ".

print $1 if $text =~ /(first(?!.*?first).*?third)/;



John
-- 
use Perl;
program
fulfillment

-- 
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