Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSmgP-0004Fk-KD for pgsql-docs@arkaria.postgresql.org; Mon, 20 May 2019 18:06:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hSmgO-0008HX-Cl for pgsql-docs@arkaria.postgresql.org; Mon, 20 May 2019 18:06:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSmgO-0008HQ-5Y for pgsql-docs@lists.postgresql.org; Mon, 20 May 2019 18:06:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSmgL-0004W8-9Z for pgsql-docs@lists.postgresql.org; Mon, 20 May 2019 18:06:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x4KI6bP8024387; Mon, 20 May 2019 14:06:37 -0400 From: Tom Lane To: geert.lobbestael@gmail.com cc: pgsql-docs@lists.postgresql.org Subject: Re: Character classes In-reply-to: <155837022049.1359.2948065118562813468@wrigleys.postgresql.org> References: <155837022049.1359.2948065118562813468@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Mon, 20 May 2019 16:37:00 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24385.1558375597.1@sss.pgh.pa.us> Date: Mon, 20 May 2019 14:06:37 -0400 Message-ID: <24386.1558375597@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Doc comments form 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