[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Manual: Incorrect explanation of /\B/
From: |
Wolfgang Laun |
Subject: |
Re: Manual: Incorrect explanation of /\B/ |
Date: |
Wed, 7 Sep 2022 21:38:00 +0200 |
The "anywhere" is too general. Both \B and \y are restricted to zero-length
substrings between any two characters and at the beginning and end of the
string. There is no single word for that AFAIK but I'm not a native speaker.
Wolfgang
On Wed, 7 Sept 2022 at 21:26, Neil R. Ormos <ormos-gnulists17@ormos.org>
wrote:
> Wolfgang Laun wrote:
>
> > Currently we have this text (in 3.7):
>
> > Matches the empty string that occurs between two
> > word-constituent characters. For example,
> > /\Brat\B/ matches 'crate', but it does not match
> > 'dirty rat'. '\B' is essentially the opposite of
> > '\y'.
>
> > It should read:
>
> > Matches when not at a word boundary, i.e.,
> > within a word or whenever both of the adjoining
> > characters are not a word character. For
> > example, /\Brat\B/ matches 'crate', but it does
> > not match 'dirty rat', or /\B/ matches 4 places
> > in '///'. '\B' is essentially the opposite of
> > '\y'.
>
> I was confused by the "opposite" language in the manual and suggest that
> the last sentence be amended to read,
>
> '\B' is essentially the opposite of '\y' in that '\B' matches anywhere
> '\y' does not match.
>
>
--
Wolfgang Laun