From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Verite <daniel@manitou-mail.org>
Cc: Robert Schreiber <bobschreiber@charter.net>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug
Date: Sat, 11 May 2019 11:59:21 -0400
Message-ID: <32565.1557590361@sss.pgh.pa.us> (raw)
In-Reply-To: <785708a0-a64c-42ee-9173-f596c1fc92ec@manitou-mail.org>
References: <785708a0-a64c-42ee-9173-f596c1fc92ec@manitou-mail.org>
"Daniel Verite" <daniel@manitou-mail.org> writes:
> Robert Schreiber wrote:
>> What appears to be happening is that the _Q? on the tail_ is being
>> matched, but _the Q is also being included in the collected data.__
> You seem to expect that % must be non-greedy and let the final Q?
> match 1 Q instead of 0, but there doesn't appear to be anything
> in the doc that supports this interpretation.
> In fact, it mentions that "%" is comparable to ".*" in POSIX
> regular expressions, and the latter _is_ greedy.
Right. You could get the behavior you want using a non-greedy quantifier,
but you'd have to use the POSIX regexp functions, not substring().
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, daniel@manitou-mail.org, bobschreiber@charter.net
Subject: Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug
In-Reply-To: <32565.1557590361@sss.pgh.pa.us>
References: <785708a0-a64c-42ee-9173-f596c1fc92ec@manitou-mail.org> <32565.1557590361@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