BUG #15046: non-greedy ignored - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #15046: non-greedy ignored
Date
Msg-id 151761974148.1240.12558693542380794378@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #15046: non-greedy ignored  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15046
Logged by:          Bob Gailer
Email address:      bgailer@gmail.com
PostgreSQL version: 10.1
Operating system:   windows 10
Description:

I start psql; enter:

postgres=# select regexp_replace('a(d)s(e)f', '\(.*?\)', '', 'g');
 regexp_replace
----------------
 asf
(1 row)

Works as expected. Then I add |q to the pattern, and the .*? becomes
greedy!

postgres=# select regexp_replace('a(d)s(e)f', '\(.*?\)|q', '', 'g');
 regexp_replace
----------------
 af
(1 row)


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: crypt function crash on postgresql 9.3.20 and 10
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #15046: non-greedy ignored