unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* On refining regexp by adding exceptions systematically
@ 2002-10-03 12:27 gnuist
  2002-10-03 18:38 ` Kaz Kylheku
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: gnuist @ 2002-10-03 12:27 UTC (permalink / raw)


Here is regular expression in emacs lisp that initially seems to work
for the job:

[A-Z][A-Z][A-Z][0-9]+


After running it on a number of uses, I find that 
there is an exception to it, namely PJP89898. 
Rather than rehashing the code after having forgotten it
and reworking my regexp expression
(every time I find an exception) in some convoluted way, is
there a systematic way to add an exception or a series of
exceptions to the regexp? I am sure that there are a number
of ways to do this and each has its merits.

I am using this regexp in two ways in a different program.
In the first one (looking-at regexp) so that it assumes that
cursor is on it. In the second one (search-forward-regexp regexp)
in a narrowed region so that one is trying to find if there is one.
It seems to me that it is a little tricky to do this. Perhaps an
example code would help with exception implemented for searching
on a line.

Thanks a lot!
gnuist007

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-10-07 14:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-03 12:27 On refining regexp by adding exceptions systematically gnuist
2002-10-03 18:38 ` Kaz Kylheku
2002-10-03 23:04   ` Kaz Kylheku
     [not found]   ` <tvikna.obd.ln@lart.ca>
2002-10-07 14:13     ` Rodney Sparapani
2002-10-05 13:31 ` Alan Mackenzie
2002-10-05 16:11   ` Stefan Monnier <foo@acm.com>
2002-10-05 17:45     ` Alan Mackenzie
2002-10-06  3:02   ` Vassil Nikolov
2002-10-06  7:48     ` Alan Mackenzie
2002-10-05 19:46 ` Christopher Browne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).