Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15398

Re: Incorrect example for `[[` command.

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Incorrect example for `[[` command.
Date 2019-09-21 17:15 -0400
Organization ITS, Case Western Reserve University
Message-ID <mailman.747.1569100529.2190.bug-bash@gnu.org> (permalink)
References <CAD0rTC7W20s7-8np7Z+CmZQczTQ+LX=Y1x01gAenewrpiJS5jw@mail.gmail.com> <8e7c8ea4-2fdf-4809-0b50-ea1bfbbec165@case.edu> <CAD0rTC68qoXvCV9SLP1dJ8Gvg71W7bg9yt8jjpmpESK-jKD7Wg@mail.gmail.com> <8a70214e-af84-999b-18d6-f2054c41eeca@case.edu>

Show all headers | View raw


On 9/20/19 8:12 PM, hk wrote:

> What is wrong is the description `zero or one instances of 'a''. But if we
> correct the right hand side word to beĀ  `[[:space:]]*(a)?b' that it does
> match what the description says.(the parenthese around `a' could be omitted).

Yeah, that's the typo.

> I was also wrong saying it was a pattern instead of a regular expression.
> It is syntatically correct as a regular expression.

That's true. According to the POSIX ERE definition, the `?' is a special
ERE character in an invalid position (it's only special after a specifier
that matches a single character, not after a separate specifier that
matches multiple characters), so it matches itself.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Incorrect example for `[[` command. Chet Ramey <chet.ramey@case.edu> - 2019-09-21 17:15 -0400

csiph-web