[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Incorrect example for `[[` command.
From: |
Chet Ramey |
Subject: |
Re: Incorrect example for `[[` command. |
Date: |
Sat, 21 Sep 2019 17:15:19 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
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/
- Re: Incorrect example for `[[` command., (continued)
Re: Incorrect example for `[[` command., Chet Ramey, 2019/09/20
Re: Incorrect example for `[[` command.,
Chet Ramey <=