* string-match: \` and \= do not match when START is non-zero
@ 2003-04-24 17:37 Kevin Rodgers
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2003-04-24 17:37 UTC (permalink / raw)
\` or \= should match the empty string at index START in STRING.
(string-match "\\`bar\\'" "foobar" 3) and (string-match "\\=bar\\'" "foobar" 3)
return nil. I think at least one of them should succeed and return 3, just like
(string-match "bar\\'" "foobar" 3) does. Otherwise, how can you anchor the
REGEXP at index START in STRING?
[time passes]
(equal (string-match REGEXP STRING START) START)
[never mind]
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: string-match: \` and \= do not match when START is non-zero
[not found] <mailman.5160.1051205842.21513.bug-gnu-emacs@gnu.org>
@ 2003-04-29 23:54 ` Kevin Rodgers
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2003-04-29 23:54 UTC (permalink / raw)
I wrote:
> \` or \= should match the empty string at index START in STRING.
>
> (string-match "\\`bar\\'" "foobar" 3) and (string-match "\\=bar\\'"
> "foobar" 3)
> return nil. I think at least one of them should succeed and return 3,
> just like
> (string-match "bar\\'" "foobar" 3) does. Otherwise, how can you anchor the
> REGEXP at index START in STRING?
>
> [time passes]
>
> (equal (string-match REGEXP STRING START) START)
>
> [never mind]
Since START can be negative, that should be:
(equal (string-match REGEXP STRING START)
(if (minusp START)
(+ (length STRING) START)
START))
I'm studying regex.c to see if I can implement \= matching in strings...
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-04-29 23:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-24 17:37 string-match: \` and \= do not match when START is non-zero Kevin Rodgers
[not found] <mailman.5160.1051205842.21513.bug-gnu-emacs@gnu.org>
2003-04-29 23:54 ` Kevin Rodgers
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).