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

From Christian Mächler
Subject Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present)
Date
Msg-id DUB128-W2990BB7605238976ADE6AEF8760@phx.gbl
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)  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present)
List pgsql-bugs
Sorry probably sent my mail to the wrong address before.

Here some more detailed examples to show why the behavior of the 3rd group is clearly wrong also according to the specification:

abc0.123def applying the first regex (with optional dot)--> abc0.12 , 3, def

abc0.123def applying the 2nd regex (with optional dot) --> , 3 ,

Although the 3rd group wasn't touched it changed it's behavior from geedy to non-greedy. abc, 0.123, def would be correct.

The behavior of the non-greedy group isn't correct either, because a match should return the FIRST match found, greedyness is only about the FOLLOWING characters, but because it will already find a match at start position it should return that and not keep looking to find another match with reduced group size.

I was just trying to help, because I think this is a pretty big issue, although not using regex atm.

Chris

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #13536: SQLParamData thows "Invalid Endian" error
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)