Re: [PATCH] regexp_positions ( string text, pattern text, flags text ) → setof int4range[]

From: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
To: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
Cc: Joel Jacobson <joel(at)compiler(dot)org>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andreas Karlsson <andreas(at)proxel(dot)se>, David Fetter <david(at)fetter(dot)org>
Subject: Re: [PATCH] regexp_positions ( string text, pattern text, flags text ) → setof int4range[]
Date: 2021-03-02 14:59:52
Message-ID: A71B3A3C-D723-400F-9895-F7FD913E3B1E@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Mar 2, 2021, at 5:34 AM, Isaac Morland <isaac(dot)morland(at)gmail(dot)com> wrote:
>
> Returning to the RE result issue, I wonder how much it actually matters where any empty matches are. Certainly the actual contents of the match don’t matter; you don’t need to be able to index into the string to extract the substring. The only scenario I can see where it could matter is if the RE is using lookahead or look back to find occurrences before or after something else. If we stipulate that the result array will be in order, then you still don’t have the exact location of empty matches but you do at least have where they are relative to non-empty matches.

I agree the contents of the match don't matter, because they are always empty. But the position matters. You could intend to split a string in multiple places using lookaheads and lookbehinds to determine the split points.


Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Georgios Kokolatos 2021-03-02 15:06:28 Re: GROUP BY DISTINCT
Previous Message Mark Dilger 2021-03-02 14:49:47 Re: Add --tablespace option to reindexdb