On Thu, Nov 15, 2001 at 12:30:23AM -0500, Michael G Schwern wrote: > These are the shortest, most correct ones so far for #1 and #2 > respectively. They're sort of a mis-mash of all the suggestions so > far. Ian's improved if/ifndef/ifdef/etc... regex is used, as is > Mike's \b suggestion. > > perl -ne '/^\s*#(?!\s*((ifn?|un)def|(el|end)?if|define|include|else)\b)/||print'
This leaves #if-- in. perl -ne '/^\s*#(?!\s*((ifn?|un)def|(el|end)?if|define|include|else)\s)/||print' takes it out. Abigail
