[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Manual: Incorrect explanation of /\B/
From: |
Neil R. Ormos |
Subject: |
Re: Manual: Incorrect explanation of /\B/ |
Date: |
Wed, 14 Sep 2022 16:09:40 -0500 (CDT) |
arnold@skeeve.com 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: [...]
> This text has been unchanged since at least
> 1997. I think it's OK as is.
I respectfully urge reconsideration. I believe it was my inquiry on the
help-gawk list that provoked W.L.'s proposal to revise the manual.
The Gawk manual states that \B "[m]atches the empty string that occurs between
two word-constituent characters," but is silent as to where else \B matches.
It is not clear from the manual text that \B also matches *outside* of a run of
word-constituent characters.
A recent man page for grep(1) recites, "\B matches the empty string provided
it's not at the edge of a word," which seems to be a concise formulation that
could be reused in Gawk's manual.
(I'm not sure what led me not to connect the dots between grep's man page and
Gawk's before I inguired on help-gawk. Nonetheless, to the extent the Gawk
manual has a tutorial function, I hope the manual's fine tradition of
explaining how regexp operators work, without expecting that readers arrive
with /a priori/ knowledge of the behavior of regexps in grep, Perl, or the
like, may continue.)