Re: BUG #16826: Regex in substring(... from ..) wrong - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #16826: Regex in substring(... from ..) wrong
Date
Msg-id CAKFQuwbsP=k5Po-=sUAJ_BQ_eQBZh9BbURtoKkm7HMiG8oBfBw@mail.gmail.com
Whole thread Raw
In response to BUG #16826: Regex in substring(... from ..) wrong  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Friday, January 15, 2021, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      16826
Logged by:          James Inform
Email address:      james.inform@pharmapp.de
PostgreSQL version: 13.1
Operating system:   Mac and Ubuntu
Description:       

Hopefully I am not messing up regex syntax, but it seems that handling of
non-greedy is not correct in substring function's regex.

When I set the non-greedy operator ? inside a regex in the substring
function, everything after the ? seems to be also treated as non-greedy,
which is wrong.

This seems to behave per the documentation in 9.7.3.5


Implementations of regex do differ so referencing prior experience for correctness has limits.

David J.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16827: macOS interrupted syscall leads to a crash
Next
From: Stephan Springl
Date:
Subject: syntactically correct query gives ERROR: failed to assign all NestLoopParams to plan nodes