help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Help with Emacs Regex


From: Bill Benedetto
Subject: Re: Help with Emacs Regex
Date: Wed, 16 Jul 2003 11:46:18 -0400

>>> Hortman, Mark writes:

  Mark> I have a rather simple regex question or two I was hoping
  Mark> someone could help me with.
  Mark>
  Mark> I need to match lines that do not begin with " and three numbers, so
  Mark> 
  Mark> "300
  Mark> "400
  Mark> "50a
  Mark> abc
  Mark> 500
  Mark> 
  Mark> I need to match all lines but the first two.  I have tried
  Mark> ^[^"0-9\{3\}]
  Mark>
  Mark> Which I, being a regex, emacs newbie interpret as search
  Mark> for all beginning of lines that dont have a " and then
  Mark> three numbers.  What gives?

Well...

^[^"] will match all lines that don't begin with a quote.  That
works in your example above.

^[^"][^0-9][^0-9] will also match and comes closer to what you
actually asked for.

Note that ^[^"][^0-9][^0-9][^0-9] *SHOULD* work except that it
doesn't work on your 3-char records.

Note too that there is probably a better way to do this but that
this seems to work.

- Bill
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
Bill Benedetto     <address@hidden>    The Goodyear Tire & Rubber Co.
I don't speak for Goodyear and they don't speak for me.  We're both happy.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]