pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: f2381430@mvrht.com
To: pgsql-docs@lists.postgresql.org
Subject: Re: Undocumented behaviour of \s in SIMILAR TO expression
Date: Tue, 22 Jan 2019 19:55:15 -0500
Message-ID: <20190123005515.GC1493@momjian.us> (raw)
In-Reply-To: <154470529073.5057.10757027183683688588@wrigleys.postgresql.org>
References: <154470529073.5057.10757027183683688588@wrigleys.postgresql.org>

On Thu, Dec 13, 2018 at 12:48:10PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/11/functions-matching.html
> Description:
> 
> SELECT ' ' SIMILAR TO '[\s]';
> returns true
> 
> SELECT ' ' SIMILAR TO '[\q]';
> generates an error: [2201B]: ERROR: invalid regular expression: invalid
> escape \ sequence
> 
> \s is not mentioned in the SIMILAR TO section
> (https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP).
> If it’s officially supported (which would be useful for my current task), it
> should be documented. Otherwise the server should generate an error like for
> other invalid escapes.

Well in:

	https://www.postgresql.org/docs/11/functions-matching.html

I see \s documented, but not \q:

	Table 9.19. Regular Expression Class-shorthand Escapes
	Escape 	Description
	\d 	[[:digit:]]
	\s 	[[:space:]]
	\w 	[[:alnum:]_] (note underscore is included)
	\D 	[^[:digit:]]
	\S 	[^[:space:]]
	\W 	[^[:alnum:]_] (note underscore is included)

Frankly, I can't even guess what you expect \q to do.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +




view thread (2+ messages)

Message-ID: <20190123005515.GC1493@momjian.us>
Permalink:  ../20190123005515.GC1493@momjian.us/
Also on:    postgresql.org/message-id/20190123005515.GC1493@momjian.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: bruce@momjian.us, f2381430@mvrht.com, pgsql-docs@lists.postgresql.org
  Subject: Re: Undocumented behaviour of \s in SIMILAR TO expression
  In-Reply-To: <20190123005515.GC1493@momjian.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