On Tue, Mar 2, 2021, at 06:31, Tom Lane wrote: > "Joel Jacobson" <j...@compiler.org> writes: > > Unless fixed, then the way I see it, I don't think we can use int4range[] > > for regexp_positions(), > > Yeah. It's a cute idea, but the semantics aren't quite right.
Having abandoned the cute idea that didn't work, here comes a new patch with a regexp_positions() instead returning setof record (start_pos integer[], end_pos integer[]). Example: SELECT * FROM regexp_positions('foobarbequebazilbarfbonk', $re$(b[^b]+)(b[^b]+)$re$, 'g'); start_pos | end_pos -----------+--------- {3,6} | {6,11} {11,16} | {16,20} (2 rows) Based on HEAD (040af779382e8e4797242c49b93a5a8f9b79c370). I've updated docs and tests. /Joel
0002-regexp-positions.patch
Description: Binary data