Kevin Murphy on 10 Nov 2003 22:15:03 -0500


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

Re: [PLUG] regexp assistance please


egrep -v '^(#.*|[[:space:]]*)$'

works for me

-Kevin Murphy

On Monday 10 November 2003 09:53 pm, Stephen Gran wrote:
> Hello all,
>
> I am trying to write a regexp that lets me use grep (or really, egrep)
> to read a standard conffile-style file.  This means that I want to
> ignore any line that begins with a comment (for which I am currently
> only allowing the use of #), any line that is just a newline, and any
> line that is just whitespace (we don't need to worry about the
> possibility of multiline strings in this case).  I can come up with
> egrep -v '^#|^$' to ignore comments and _only_ newlines, but I would
> also like to ignore unseen whitespace (like \s*) - [:space:] just doesn't
> seem to be working for me.  Can somebody whack me with a cluebat?
>
> Thanks,

___________________________________________________________________________
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