Re: regexp_replace not respecting greediness

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Simon Ellmann <simon.ellmann@tum.de>
Cc: "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2025-09-19T14:09:43Z
Lists: pgsql-bugs
On Friday, September 19, 2025, Simon Ellmann <simon.ellmann@tum.de> wrote:

> With the following regular expression, the second .* seems to match
> non-greedily although (if I am correct) it should match greedily:
>

Working as documented in rule 6:

https://www.postgresql.org/docs/current/functions-matching.html#POSIX-MATCHING-RULES

David J.