\W excludes underscore
Erwin Brandstetter <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.devel.documentation |
|---|---|
| Message-ID | <CAGHENJ7xxZXerZKo2e4x+AB27jNgbjmYM370ORqEP=jK_Kdb_g@mail.gmail.com> |
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