Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present)
Date
Msg-id 26003.1438700337@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present)  (Christian Mächler<christian_maechler@hotmail.com>)
Responses Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present)  (Christian Mächler<christian_maechler@hotmail.com>)
List pgsql-bugs
Christian Mächler <christian_maechler@hotmail.com> writes:
> Here some more detailed examples to show why the behavior of the 3rd group is clearly wrong also according to the
specification:

What specification are you reading?  The POSIX standard for regular
expressions doesn't mention non-greedy quantifiers at all.

As David says, these examples appear to be following what's stated in
http://www.postgresql.org/docs/9.4/static/functions-matching.html#POSIX-MATCHING-RULES
The Spencer regex engine we use has a notion of greediness or
non-greediness of the entire regex, and further that that takes precedence
for determining the overall match length over greediness of individual
subexpressions.  That behavior might be inconvenient for this particular
use-case, but that doesn't make it a bug.
        regards, tom lane



pgsql-bugs by date:

Previous
From: Christian Mächler
Date:
Subject: Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present)
Next
From: Tom Lane
Date:
Subject: Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present)