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

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

Re: search for any two consecutive uppercase characters


From: Colin S. Miller
Subject: Re: search for any two consecutive uppercase characters
Date: Thu, 13 Aug 2009 13:23:24 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Pascal J. Bourguignon wrote:
Horacio Suarez <address@hidden> writes:

Hello all:

Is there a way to search for any two consecutive uppercase characters? In example 
"PÉREZ" or
"GONZÁLEZ"

Yes, this is difficult, because of the accented letters.  There is no
[:upper:] in emacs regular expressions.  It might be possible to build
a syntax table or something to identify uppercase letters including
accented ones, but AFAIK, there's nothing built in.  The simpliest
would be to prepare a regular expression explicitely listing all the
characters you'd want, something like:

          "\\<[A-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ]+\\>"

Isn't
C-u C-s   (aka isearch-forward-regexp)
[A-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ]\{2,\}
better?

here \{2,\}
means two (or more) of the preceding expression.

HTH,
Colin S. Miller


--
Replace the obvious in my email address with the first three letters of the 
hostname to reply.


reply via email to

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