\W excludes underscore

From: Erwin Brandstetter <brsaweda(at)gmail(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: \W excludes underscore
Date: 2019-05-07 23:35:38
Message-ID: CAGHENJ7xxZXerZKo2e4x+AB27jNgbjmYM370ORqEP=jK_Kdb_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

https://www.postgresql.org/docs/current/functions-matching.html#POSIX-CLASS-SHORTHAND-ESCAPES-TABLE
Table 9.19. Regular Expression Class-shorthand Escape:

> \w [[:alnum:]_] (note underscore is included)
> ...
> \W [^[:alnum:]_] (note underscore is included)

This is misleading as \w *includes* underscore, but \W *excludes* it. I
suggest:

\w [[:alnum:]_] (underscore is included)
...
\W [^[:alnum:]_] (underscore is excluded)

Regards
Erwin

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2019-05-08 01:41:30 Re: \W excludes underscore
Previous Message PG Doc comments form 2019-05-06 11:08:48 Latest ISO is 2016, not 2011