regexp_replace not respecting greediness - Mailing list pgsql-bugs

From Simon Ellmann
Subject regexp_replace not respecting greediness
Date
Msg-id 1B268DC1-F058-4243-B6F8-71451FB68F08@tum.de
Whole thread Raw
Responses Re: regexp_replace not respecting greediness
Re: regexp_replace not respecting greediness
List pgsql-bugs
With the following regular expression, the second .* seems to match non-greedily although (if I am correct) it should match greedily:

postgres=# SELECT REGEXP_REPLACE('jane.smith@example.com', '.*?@.*', 'ab');
 regexp_replace 
----------------
 abexample.com
(1 row)


Affected version: PostgreSQL 17.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 15.2.1 20250813, 64-bit

Cheers,
Simon

--

Research associate
Chair for database systems
Department of Informatics
TU München  Tel: +49 89 289 17276
Boltzmannstr. 3  E-Mail: simon.ellmann@tum.de
D-85748 Garching bei München, Germany

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19058: Empty repomd.xml.asc file
Next
From: "David G. Johnston"
Date:
Subject: Re: regexp_replace not respecting greediness