unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Christopher Dimech <dimech@gmx.com>
To: tomas@tuxteam.de
Cc: help-gnu-emacs@gnu.org, Jean Louis <bugs@gnu.support>
Subject: Re: Determining existence of text following point
Date: Tue, 18 May 2021 14:50:21 +0200	[thread overview]
Message-ID: <trinity-72b23eac-612b-4aa4-9f9d-ee7137a9d45a-1621342221826@3c-app-mailcom-bs13> (raw)
In-Reply-To: <20210518123541.GF11623@tuxteam.de>

> Sent: Wednesday, May 19, 2021 at 12:35 AM
> From: tomas@tuxteam.de
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "Jean Louis" <bugs@gnu.support>, help-gnu-emacs@gnu.org
> Subject: Re: Determining existence of text following point
>
> On Tue, May 18, 2021 at 02:23:25PM +0200, Christopher Dimech wrote:
> > > 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.
> 
> This is outside the context of character classes, i.e. outside [...].
> 
> > It is unfortunate that there exist so many different syntaxes for writing
> > regular expressions.
> 
> Yet all those syntaxes coincide in that one thing: "^" outside of
> brackets means "anchor at the beginning" (of line, most of the time,
> but it could be "of string" or similar), whereas inside of character
> class brackets (but _only_ right after the opening bracket!) it
> means complement.
> 
> This is an unfortunate quirk, but those notations are around since
> the early 1970s, so that ship has sailed. Go and tell a phisicist
> to use something else than the "uppercase L" for the Lagrangian.

Richard Feynman used to come up with very strange notation, and we relied on
Freeman Dyson to make sense in a familiar mathematical notation.  Einstein
had the same problem.
 
> The multitude of regular expression extensions and implementations
> is an issue, yes, but a completely different one.
> 
> Cheers
>  - t
>



  reply	other threads:[~2021-05-18 12:50 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 21:46 Determining existence of text following point michael-franzese
2021-05-17 22:02 ` Skip Montanaro
2021-05-17 22:31   ` michael-franzese
2021-05-17 23:05     ` Eric Abrahamsen
2021-05-17 23:15       ` michael-franzese
2021-05-17 23:36         ` Skip Montanaro
2021-05-18  0:09         ` Eric Abrahamsen
2021-05-18  0:37           ` michael-franzese
2021-05-18  8:24           ` michael-franzese
2021-05-18  8:56           ` Jean Louis
2021-05-18  9:31             ` Christopher Dimech
2021-05-18  9:42               ` Jean Louis
2021-05-18  9:54               ` Jean Louis
2021-05-18 10:08                 ` Christopher Dimech
2021-05-18 11:07                   ` tomas
2021-05-18 11:26                     ` Christopher Dimech
2021-05-18 11:56                       ` Jean Louis
2021-05-18 12:23                         ` Christopher Dimech
2021-05-18 12:35                           ` tomas
2021-05-18 12:50                             ` Christopher Dimech [this message]
2021-05-18 12:02                       ` tomas
2021-05-18 12:15                         ` Christopher Dimech
2021-05-18 12:27                           ` tomas
2021-05-18 12:43                             ` Christopher Dimech
2021-05-18 12:44                             ` Jean Louis
2021-05-18 12:28                         ` Christopher Dimech
2021-05-18 12:47                           ` Jean Louis
2021-05-18 20:50             ` michael-franzese
2021-05-18 22:04               ` Jean Louis
2021-05-18 22:17               ` Jean Louis
2021-05-19  7:28                 ` michael-franzese
2021-05-19  8:05                   ` michael-franzese
2021-05-19 10:23                   ` Jean Louis
2021-05-19 10:32                     ` michael-franzese
2021-05-19 12:31                     ` michael-franzese
2021-05-17 23:53       ` michael-franzese
2021-05-18  8:47     ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-72b23eac-612b-4aa4-9f9d-ee7137a9d45a-1621342221826@3c-app-mailcom-bs13 \
    --to=dimech@gmx.com \
    --cc=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tomas@tuxteam.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).