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 8837.1330979413@sss.pgh.pa.us
Whole thread Raw
In response to Re: Our regex vs. POSIX on "longest match"  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> On the otherhand, I think requiring an "overall longest match" makes
> your implementation non-polynomial complexity.

Only if you don't know how to implement it -- a DFA-based implementation
doesn't have much trouble with this.

> [ equivalence of knapsack problem to regexes with bounded repetition ]

Interesting, but note that neither the POSIX spec nor our implementation
permit arbitrarily large repetition counts, so the theoretical
NP-completeness is only theoretical.

> The question is, what are users expecting of the PostgreSQL regex
> implementation?

I think a minimum expectation is that we adhere to the POSIX
specification.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: elegant and effective way for running jobs inside a database
Next
From: Simon Riggs
Date:
Subject: Re: foreign key locks, 2nd attempt