From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: gnuist007@hotmail.com (gnuist) Newsgroups: gmane.emacs.help Subject: On refining regexp by adding exceptions systematically Date: 3 Oct 2002 05:27:55 -0700 Organization: http://groups.google.com/ Sender: help-gnu-emacs-admin@gnu.org Message-ID: <9e8ebeb2.0210030427.4544cb00@posting.google.com> NNTP-Posting-Host: localhost.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1033714975 10083 127.0.0.1 (4 Oct 2002 07:02:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 4 Oct 2002 07:02:55 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17xMU9-0002cR-00 for ; Fri, 04 Oct 2002 09:02:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17xLkY-00020m-00; Fri, 04 Oct 2002 02:15:46 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help,gnu.utils.help,comp.lang.lisp,comp.unix.shell,comp.unix.programmer Original-Lines: 25 Original-NNTP-Posting-Host: 209.179.38.34 Original-X-Trace: posting.google.com 1033648075 14471 127.0.0.1 (3 Oct 2002 12:27:55 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 3 Oct 2002 12:27:55 GMT Original-Xref: nntp.stanford.edu gnu.emacs.help:105665 gnu.utils.help:4070 comp.lang.lisp:95355 comp.unix.shell:133837 comp.unix.programmer:143683 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2244 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2244 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