Re: regexp_matches and regexp_split are inconsistent - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: regexp_matches and regexp_split are inconsistent
Date
Msg-id 162867790708102244q667d682ak5b37ac03c20b78d7@mail.gmail.com
Whole thread Raw
In response to regexp_matches and regexp_split are inconsistent  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>
> If you count carefully, you will see that regexp_matches() reports a
> match of the pattern at the start of the string and at the end of the
> string, and also just before 'c' (after the match to the single space).
> However, regexp_split() disregards these "degenerate" matches of the
> same pattern.
>
> Is this what we want?  Arguably regexp_split is doing the most
> reasonable thing for its intended usage, but the strict definition of
> regexp matching seems to require what regexp_matches does.  I think
> we need to either change one function to match the other, or else
> document the inconsistency.
>

Regexp_matches behave is correct, but less usable. I thing  space from
virtual begin to first char and from last char to virtual end can be
eliminated.

Regards
Pavel Stehule


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Unexpected VACUUM FULL failure
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Wrote a connect-by feature