[Top][All Lists]

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

Re: re-search repeat by \{N\} not working. Bug?

From: Friedrich Laher
Subject: Re: re-search repeat by \{N\} not working. Bug?
Date: Tue, 23 Aug 2005 07:36:48 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

Thank you.

It's in an 400 line program and I just forgot that the" \" needs to coded as "\\"
 interesting is that that iteratorconstruct is missing in the hardcopy of

"The GNU Emacs Lisap Reference Manual" for Version 20
33.2.1 Syntax of Regular Expressions even says

 "no new special characters will be defined in the future"

rgb wrote:
"\ [A-Z]\{3\}\ "

should find a 3letter Word surrounded by blanks


I'm not sure of your indended purpose in the "\ "
sequence but I'd guess that could be your problem.

All these work fine for me.  Each matches 3 letter words
with slight differences in what constitutes a word.  For
example the first won't match a word if it begins in the
first column or ends in the last column of a line or is
delimited by punctuation such as a period or comma or is
preceeded or followed by a tab rather than a space.  The
2nd allows for tab characters and possibly eol but not
punctuation.  The 3rd and 4th are very similar.  They
allow punction, tab, space and eol characters and differ
only in whether the delimiting character is considered
part of the match or just required but not actually part
of it.

Interactively typed          String used programmatically
 [A-Za-z]\{3\} <ret>         " [A-Za-z]\\{3\\} "
\s-[A-Za-z]\{3\}\s-<ret>     "\\s-[A-Za-z]\\{3\\}\\s-"
\Sw[A-Za-z]\{3\}\Sw<ret>     "\\Sw[A-Za-z]\\{3\\}\\Sw"
\b[A-Za-z]\{3\}\b<ret>       "\\b[A-Za-z]\\{3\\}\\b"

Help-gnu-emacs mailing list


reply via email to

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