help-gnu-emacs
[Top][All Lists]
Advanced

[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:23:25 +0200

> Sent: Tuesday, May 18, 2021 at 11:56 PM
> From: "Jean Louis" <bugs@gnu.support>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: tomas@tuxteam.de, help-gnu-emacs@gnu.org
> Subject: Re: Determining existence of text following point
>
> * Christopher Dimech <dimech@gmx.com> [2021-05-18 14:27]:
> > > > (setq sa (string-match "[^[:blank:]]" "     "))
> 
> > I find the description different from what string-match actually
> > returns.
> 
> The symbol ^ means "not following", and that regular expression means
> match non-blanks.
> 
> (string-match "[^[:blank:]]" "     ") ⇒ nil
> (string-match "[[:blank:]]" "     ") ⇒ 0

You are correct.  "^" means match everything but the following class.

I am quite used on see "^" to mean "beginning of line".  So just read
it as I usually do.

It is unfortunate that there exist so many different syntaxes for writing
regular expressions.

> -- 
> Jean
> 
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
> 
> Sign an open letter in support of Richard M. Stallman
> https://stallmansupport.org/
> https://rms-support-letter.github.io/
> 
>



reply via email to

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