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

From Tom Lane
Subject Re: Our regex vs. POSIX on "longest match"
Date
Msg-id 2033.1330892403@sss.pgh.pa.us
Whole thread Raw
In response to Re: Our regex vs. POSIX on "longest match"  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: Our regex vs. POSIX on "longest match"  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
hubert depesz lubaczewski <depesz@depesz.com> writes:
> 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.

[ shrug... ]  That sounds good, but it's pretty much vacuous as far as
defining a principled alternative behavior goes.  It's easy to
demonstrate cases where atoms *must* be influenced by other ones.
A trivial example is(.*)(.*)
It doesn't matter whether the second atom is greedy or not: it's not
going to get to eat anything because the first one does instead.
IOW this is just the same as(.*)(.*?)
--- they are both overall-greedy.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: xlog min recovery request ... is past current point ...
Next
From: Tom Lane
Date:
Subject: Re: Collect frequency statistics for arrays