* re-search-forward strange match
@ 2018-05-21 17:32 Andreas Röhler
2018-05-21 17:40 ` Noam Postavsky
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Röhler @ 2018-05-21 17:32 UTC (permalink / raw)
To: Help Gnu Emacs mailing list
Calling re-search-forward at string "foo1" like below, it matches at
first char "o".
(re-search-forward "#?[xo]?[a-f0-9]+" nil t 1)foo1
Doesn't the regexp say a possible [xo] must be followed by at least one
of "a-f0-9"? Where the second "o" is not a part...
Cheers,
Andreas
GNU Emacs 26.1 (build 1, i686-pc-linux-gnu, GTK+ Version 3.14.5) of
2018-04-10
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: re-search-forward strange match
2018-05-21 17:32 re-search-forward strange match Andreas Röhler
@ 2018-05-21 17:40 ` Noam Postavsky
2018-05-21 19:15 ` Andreas Röhler
0 siblings, 1 reply; 3+ messages in thread
From: Noam Postavsky @ 2018-05-21 17:40 UTC (permalink / raw)
To: Andreas Röhler; +Cc: Help Gnu Emacs mailing list
On 21 May 2018 at 13:32, Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:
> Calling re-search-forward at string "foo1" like below, it matches at first
> char "o".
>
> (re-search-forward "#?[xo]?[a-f0-9]+" nil t 1)foo1
It matches "f" for me. Not sure how you decided it matches "o".
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: re-search-forward strange match
2018-05-21 17:40 ` Noam Postavsky
@ 2018-05-21 19:15 ` Andreas Röhler
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Röhler @ 2018-05-21 19:15 UTC (permalink / raw)
To: Noam Postavsky; +Cc: Help Gnu Emacs mailing list
On 21.05.2018 19:40, Noam Postavsky wrote:
> On 21 May 2018 at 13:32, Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:
>> Calling re-search-forward at string "foo1" like below, it matches at first
>> char "o".
>>
>> (re-search-forward "#?[xo]?[a-f0-9]+" nil t 1)foo1
>
> It matches "f" for me. Not sure how you decided it matches "o".
>
Oh yeah, thanks, a good old mistake...
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-21 19:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-21 17:32 re-search-forward strange match Andreas Röhler
2018-05-21 17:40 ` Noam Postavsky
2018-05-21 19:15 ` Andreas Röhler
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.