Michael C. Toren on 11 Nov 2003 00:46:02 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] regexp assistance please


On Mon, Nov 10, 2003 at 10:45:00PM -0500, Stephen Gran wrote:
> > The "[:space:]" needs to occur within a character class, which
> > effectively requires the use of double square brackets.  Try:
> > 
> > 	egrep -v '^[[:space:]]*(#|$)'
> 
> Ah that explains my problem.  Thank you very much.  Just to mke sure I
> am parsing your solution correctly, I read this as: if the line begins
> with 0 or more spaces, followed by either # or newline, then ignore it -
> yes?  That looks like exactly what I want.

Yup, you got it.  Ofcourse, if you'll be doing even further analysis of
the output of the above grep command, you may want to investigate writing
your application in a language more suited to text processing, such as
perl.

-mct
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug