Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: More POSIX Issue 8 changes (msg #2)



On Thu 26 Mar 2020 at 13:12:01 +0700, Robert Elz wrote:
> ERE's gain the ability to match shortest (minimal, including empty where
> the actual expression allows it) leftmost strings (as an alternative to
> the normal longest possible leftmost match).   I'm not sure I follow
> everything that's in this one, so see the URL, but I believe the idea
> is that
> 	ab*?
> will match just "a" regardless of how many b's follow it,
> and
> 	a[bc]*?c
> matched against abbbcbbbcbbbcd  would match abbbc rather than abbbcbbbcbbbc
> There is also a new flag REG_MINIMAL which changes the default match for
> ERE's from longest to shortest match.
> URL: https://austingroupbugs.net/view.php?id=793 

There seems to be a mistake in that text:

     For example, the ERE ".*c" matches the last character ('c') in the
     string "abc abc",

should likely be

     For example, the ERE ".*c" matches all characters up to the last
     character ('c') in the string "abc abc",

and that is indeed what our egrep seems to do:

    $ echo abc-abc | egrep --color ".*c"
    abc-abc

with the whole of abc-abc coloured red.

Where does one report such mistakes?

-Olaf.
-- 
Olaf 'Rhialto' Seibert -- rhialto at falu dot nl
___  Anyone who is capable of getting themselves made President should on
\X/  no account be allowed to do the job.       --Douglas Adams, "THGTTG"

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index