* re-search repeat by \{N\} not working. Bug?
@ 2005-08-21 16:00 Friedrich Laher
2005-08-22 18:50 ` Kevin Rodgers
0 siblings, 1 reply; 6+ messages in thread
From: Friedrich Laher @ 2005-08-21 16:00 UTC (permalink / raw)
or what's to be done?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: re-search repeat by \{N\} not working. Bug?
2005-08-21 16:00 re-search repeat by \{N\} not working. Bug? Friedrich Laher
@ 2005-08-22 18:50 ` Kevin Rodgers
2005-08-22 20:41 ` Friedrich Laher
[not found] ` <mailman.4682.1124743817.20277.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 6+ messages in thread
From: Kevin Rodgers @ 2005-08-22 18:50 UTC (permalink / raw)
Friedrich Laher wrote:
> or what's to be done?
Post an actual example, please.
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: re-search repeat by \{N\} not working. Bug?
2005-08-22 18:50 ` Kevin Rodgers
@ 2005-08-22 20:41 ` Friedrich Laher
[not found] ` <mailman.4682.1124743817.20277.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 6+ messages in thread
From: Friedrich Laher @ 2005-08-22 20:41 UTC (permalink / raw)
e.g.
"\ [A-Z]\{3\}\ "
should find a 3letter Word surrounded by blanks
Kevin Rodgers wrote:
> Friedrich Laher wrote:
>
>> or what's to be done?
>
>
> Post an actual example, please.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <mailman.4682.1124743817.20277.help-gnu-emacs@gnu.org>]
* Re: re-search repeat by \{N\} not working. Bug?
[not found] ` <mailman.4682.1124743817.20277.help-gnu-emacs@gnu.org>
@ 2005-08-22 22:39 ` rgb
2005-08-23 5:36 ` Friedrich Laher
[not found] ` <mailman.4718.1124776601.20277.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 6+ messages in thread
From: rgb @ 2005-08-22 22:39 UTC (permalink / raw)
> "\ [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"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: re-search repeat by \{N\} not working. Bug?
2005-08-22 22:39 ` rgb
@ 2005-08-23 5:36 ` Friedrich Laher
[not found] ` <mailman.4718.1124776601.20277.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 6+ messages in thread
From: Friedrich Laher @ 2005-08-23 5:36 UTC (permalink / raw)
[-- Attachment #1.1: Type: text/plain, Size: 1625 bytes --]
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
and
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
>Help-gnu-emacs@gnu.org
>http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>
>
>
[-- Attachment #1.2: Type: text/html, Size: 2280 bytes --]
[-- Attachment #2: Type: text/plain, Size: 152 bytes --]
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <mailman.4718.1124776601.20277.help-gnu-emacs@gnu.org>]
* Re: re-search repeat by \{N\} not working. Bug?
[not found] ` <mailman.4718.1124776601.20277.help-gnu-emacs@gnu.org>
@ 2005-08-23 10:00 ` Johan Bockgård
0 siblings, 0 replies; 6+ messages in thread
From: Johan Bockgård @ 2005-08-23 10:00 UTC (permalink / raw)
Friedrich Laher <fritz.laher@schmieder-laher.de> writes:
> "no new special characters will be defined in the future"
It is the construct "\{" that is special, not the character "{".
The manual says
"The special characters are `.', `*', `+', `?', `[', `]', `^',
`$', and `\'; no new special characters will be defined in the
future. Any other character appearing in a regular expression is
ordinary, unless a `\' precedes it."
^^^^^^^^^^^^^^^^^^^^^^^^
--
Johan Bockgård
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-08-23 10:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-21 16:00 re-search repeat by \{N\} not working. Bug? Friedrich Laher
2005-08-22 18:50 ` Kevin Rodgers
2005-08-22 20:41 ` Friedrich Laher
[not found] ` <mailman.4682.1124743817.20277.help-gnu-emacs@gnu.org>
2005-08-22 22:39 ` rgb
2005-08-23 5:36 ` Friedrich Laher
[not found] ` <mailman.4718.1124776601.20277.help-gnu-emacs@gnu.org>
2005-08-23 10:00 ` Johan Bockgård
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).