BUG #15046: non-greedy ignored

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: bgailer(at)gmail(dot)com
Subject: BUG #15046: non-greedy ignored
Date: 2018-02-03 01:02:21
Message-ID: 151761974148.1240.12558693542380794378@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15046
Logged by: Bob Gailer
Email address: bgailer(at)gmail(dot)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)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2018-02-03 01:16:05 Re: BUG #15046: non-greedy ignored
Previous Message Tom Lane 2018-02-02 23:38:11 Re: crypt function crash on postgresql 9.3.20 and 10