emacs-devel
[Top][All Lists]
Advanced

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

Re: Make \< and \> match symbol boundaries


From: Paul Eggert
Subject: Re: Make \< and \> match symbol boundaries
Date: Sun, 28 Oct 2001 12:33:34 -0800 (PST)

> From: Richard Stallman <address@hidden>
> Date: Sun, 28 Oct 2001 07:06:39 -0700 (MST)
> 
> I think it would be better to introduce some other way of
> specifying a symbol boundary search.  Perhaps \[ amd \].

\[ is already taken; it matches [.  \{ is also taken.

We're getting a bit short of ASCII characters, so I'm not sure it's
wise to reserve two more escape sequences for this.

Here's another idea: generalize the existing regexps \b, \B, etc. to
support arbitrary classes and syntaxes, not just word syntax.  For
example, to generalize \b we could add the following regexps:

\-bsC matches the empty string, but only at the beginning or end of a
      sequence of one or more characters whose syntax is C.
\-bSC matches the empty string, but only at the beginning or end of a
      sequence of one or more characters whose syntax is not C.
\-bcC matches the empty string, but only at the beginning or end of a
      sequence of one or more characters that belongs to the category C.
\-bCC matches the empty string, but only at the beginning or end of a
      sequence of one or more characters that do not belong to the category C.

\b is equivalent to \-bsw.

If we take this approach, then \-<s_ and \->s_ would have the desired
interpretation of matching symbol boundaries.



reply via email to

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