pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christian Mächler <christian_maechler@hotmail.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present)
Date: Tue, 4 Aug 2015 15:49:02 +0200
Message-ID: <DUB128-W2990BB7605238976ADE6AEF8760@phx.gbl> (raw)
In-Reply-To: <CAKFQuwaXQvXx9OEDNXAA5eXdbP0CKBnWow+L0aoh1vH2J6LrtQ@mail.gmail.com>
References: <20150803224450.1115.8803@wrigleys.postgresql.org>
	<CAKFQuwaXQvXx9OEDNXAA5eXdbP0CKBnWow+L0aoh1vH2J6LrtQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
 		 	   		  =

view thread (10+ messages)  latest in thread

Message-ID: <DUB128-W2990BB7605238976ADE6AEF8760@phx.gbl>
Permalink:  ../DUB128-W2990BB7605238976ADE6AEF8760@phx.gbl/
Also on:    postgresql.org/message-id/DUB128-W2990BB7605238976ADE6AEF8760@phx.gbl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: christian_maechler@hotmail.com, david.g.johnston@gmail.com
  Subject: Re: BUG #13538: REGEX non-greedy is working incorrectly (and also greedy matches fail if non-greedy is present)
  In-Reply-To: <DUB128-W2990BB7605238976ADE6AEF8760@phx.gbl>
  References: <20150803224450.1115.8803@wrigleys.postgresql.org> <CAKFQuwaXQvXx9OEDNXAA5eXdbP0CKBnWow+L0aoh1vH2J6LrtQ@mail.gmail.com> <DUB128-W2990BB7605238976ADE6AEF8760@phx.gbl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox