Re: Our regex vs. POSIX on "longest match" - Mailing list pgsql-hackers

From hubert depesz lubaczewski
Subject Re: Our regex vs. POSIX on "longest match"
Date
Msg-id 20120304183719.GA10935@depesz.com
Whole thread Raw
In response to Re: Our regex vs. POSIX on "longest match"  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Our regex vs. POSIX on "longest match"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Mar 04, 2012 at 12:34:22PM -0500, Tom Lane wrote:
> Well, that's just an arbitrary example.  The cases I remember people
> complaining about in practice were the other way round: greedy
> quantifier followed by non-greedy, and they were unhappy that the
> non-greediness was effectively not respected (because the overall RE was
> taken as greedy).  So you can't fix the issue by pointing to POSIX and
> saying "overall greedy is always the right thing".

I was one of the complaining, and my point was that deciding for whole
regexp whether it's greedy or non-greedy is a bug (well, it might be
documented, but it's still *very* unexpected).

I stand on position that mixing greedy and non-greedy operators should
be possible, and that it should work according to POLA - i.e. greedines
of given atom shouldn't be influenced by other atoms.

Best regards,

depesz


-- 
The best thing about modern society is how easy it is to avoid contact with it.
                  http://depesz.com/
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Collect frequency statistics for arrays
Next
From: Greg Jaskiewicz
Date:
Subject: Re: autovacuum locks