On Jun 28, John W. Krahn said:

>>    $line =~ /^(\d+\.\d+\.\d+\.\d+) (.+?) (.+?) \[(.+?)\] \"(?:(.+?) )?(.+)(?:
>> (.+?))?\" (\d+) (.+?) \"(.+?)\" \"(.+?)\"$/;
>
>If you are not using $2, $3, $5, $7 and $10 why capture them?  You
>should probably replace .+? with something more meaningful that won't
>backtrack.

There's probably not much backtracking happening, anyway.  Quantifiers are
intelligent.  But it's probably saner to make most of them \S+ instead.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
CPAN ID: PINYAN    [Need a programmer?  If you like my work, let me know.]
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


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