On Fri 14 Apr 2023 at 12:01:39 (-0400), rhkra...@gmail.com wrote: > On Thursday, April 13, 2023 10:36:08 PM Greg Wooledge wrote: > > Anyway, here's the POSIX documentation section: > > > > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#t > > ag_18_13 > > > > And the relevant piece of text: > > > > [ If an open bracket introduces a bracket expression as in XBD RE > > Bracket Expression, except that the <exclamation-mark> character > > ( '!' ) shall replace the <circumflex> character ( '^' ) in its > > role in a non-matching list in the regular expression notation, it > > shall introduce a pattern bracket expression. A bracket expression > > starting with an unquoted <circumflex> character produces unspecified > > results. Otherwise, '[' shall match the character itself. > > Wow -- I thought this was an English language list :-( > > But seriously, that seems very hard to interpret / understand.
The quick answer: it's a Standards document, so it's a penalty you pay for precision. Look at the opening of that section: "2.13.1 Patterns Matching a Single Character "The following patterns matching a single character shall match a single character:" BTW, the authors of these documents might be the sort of people referred to by the early RFC authors in RFC 1000: "We weren't sure whether there was really room to think hard about these problems; surely someone from the east would be along by and by to bring the word. … "We had no official charter. Most of us were graduate students and we expected that a professional crew would show up eventually to take over the problems we were dealing with. … "I remember having great fear that we would offend whomever the official protocol designers were, and I spent a sleepless night composing humble words for our notes. The basic ground rules were that anyone could say anything and that nothing was official." Cheers, David.