[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Determining existence of text following point
From: |
Christopher Dimech |
Subject: |
Re: Determining existence of text following point |
Date: |
Tue, 18 May 2021 14:15:27 +0200 |
> Sent: Wednesday, May 19, 2021 at 12:02 AM
> From: tomas@tuxteam.de
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: Determining existence of text following point
>
> On Tue, May 18, 2021 at 01:26:12PM +0200, Christopher Dimech wrote:
>
> [...]
>
> > > On Tue, May 18, 2021 at 12:08:42PM +0200, Christopher Dimech wrote:
> > > > How is it that the following returns nil?
> > > >
> > > > (setq sa (string-match "[^[:blank:]]" " "))
> > >
> > > Because you stated to match any non-blank character and there
> > > are only blank characters to match.
> >
> > The docstring for string-match is
> >
> > "Return index of start of first match for REGEXP in STRING, or nil."
> >
> > I find the description different from what string-match actually returns.
>
> ?
string-match looks as though it returns the index of the last match because
(setq sa (string-match "[^[:blank:]]" " A neutrino is a fermion"))
(setq sb (not (string-match "[^[:blank:]]" " A neutrino is a fermion")))
gives
sa: 2
sb: nil
> Cheers
> - t
>
- Re: Determining existence of text following point, (continued)
- Re: Determining existence of text following point, Jean Louis, 2021/05/18
- Re: Determining existence of text following point, Jean Louis, 2021/05/18
- Re: Determining existence of text following point, Christopher Dimech, 2021/05/18
- Re: Determining existence of text following point, tomas, 2021/05/18
- Re: Determining existence of text following point, Christopher Dimech, 2021/05/18
- Re: Determining existence of text following point, Jean Louis, 2021/05/18
- Re: Determining existence of text following point, Christopher Dimech, 2021/05/18
- Re: Determining existence of text following point, tomas, 2021/05/18
- Re: Determining existence of text following point, Christopher Dimech, 2021/05/18
- Re: Determining existence of text following point, tomas, 2021/05/18
- Re: Determining existence of text following point,
Christopher Dimech <=
- Re: Determining existence of text following point, tomas, 2021/05/18
- Re: Determining existence of text following point, Christopher Dimech, 2021/05/18
- Re: Determining existence of text following point, Jean Louis, 2021/05/18
- Re: Determining existence of text following point, Christopher Dimech, 2021/05/18
- Re: Determining existence of text following point, Jean Louis, 2021/05/18
- Re: Determining existence of text following point, michael-franzese, 2021/05/18
- Re: Determining existence of text following point, Jean Louis, 2021/05/18
- Re: Determining existence of text following point, Jean Louis, 2021/05/18
- Re: Determining existence of text following point, michael-franzese, 2021/05/19
- Re: Determining existence of text following point, michael-franzese, 2021/05/19