pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: geert.lobbestael@gmail.com
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Character classes
Date: Mon, 20 May 2019 14:06:37 -0400
Message-ID: <24386.1558375597@sss.pgh.pa.us> (raw)
In-Reply-To: <155837022049.1359.2948065118562813468@wrigleys.postgresql.org>
References: <155837022049.1359.2948065118562813468@wrigleys.postgresql.org>

PG Doc comments form <noreply@postgresql.org> writes:
> On https://www.postgresql.org/docs/11/functions-matching.html paragraph
> 9.7.3.2. Bracket Expressions says "Standard character class names are:
> alnum, alpha, blank, cntrl, digit, graph, lower, print, punct, space, upper,
> xdigit". The class "ascii" exists, but is not mentioned (probably a
> combination of some of the other classes). Are there any other classes?

Hm, fair question.  I think the text means to say that these are the
character class names required by the POSIX regexp spec, which is
accurate.  A look into our src/backend/regex/regc_locale.c will show
you that we also implement "ascii", and no others.  That probably ought
to be documented.

> Do they work only for ASCII characters (e.g. '\u00A0' is not picked up
> by '[:blank:]')?

The POSIX ones are implemented by calling the C library, so it's whatever
the ctype.h and wctype.h functions think is appropriate for your LC_CTYPE
setting.

The 20-year-old reference in our text to ctype(3) seems rather unhelpful
today; in the first place, there's no such man page on my Linux systems,
and in the second place, wctype(3) is more important if it exists, and
in the third place what a reader actually wants to know is that this
is controlled by the LC_CTYPE server parameter.  It'd likely be better
to dump the man-page reference altogether and instead point readers to
our "Locale Support" chapter.

			regards, tom lane





view thread (3+ messages)  latest in thread

Message-ID: <24386.1558375597@sss.pgh.pa.us>
Permalink:  ../24386.1558375597@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24386.1558375597@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, geert.lobbestael@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: Character classes
  In-Reply-To: <24386.1558375597@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox