On Wed, Nov 14, 2001 at 09:03:21PM -0500, Jeff 'japhy' Pinyan wrote:
> On Nov 14, Michael G Schwern said:
> 
> >    1) Strips all comment-only lines from a Perl program (ie. /^\s*#/)
> >       except those which are C pre-processor commands.  (It's not
> >       necessary to worry about if you're inside a string or not).
> 
> perl -pe 's/^\s*#\s*(?!include|define|if(n?def)?|el(se|if)|undef|endif).*//s'

Ahh, you fell victim to the same problem I did.  Because of the
look-ahead, that skips.

#  define FOO 1


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One
O you fat bastard                                           
anus clogged (library paste)        
you're not laughing now
        -- Halfjack

Reply via email to