Re: Regexp named capture groups

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Joel Jacobson <joel(at)trustly(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Regexp named capture groups
Date: 2018-02-03 13:49:35
Message-ID: 20180203134935.GB5451@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 03, 2018 at 01:55:31PM +0100, Pavel Stehule wrote:
> 2018-02-03 11:19 GMT+01:00 Joel Jacobson <joel(at)trustly(dot)com>:
>> Is anyone working on this feature[1] also for PostgreSQL's regex
>> engine?

Note that I know of.

>> I think this feature would be awesome, for the reasons mentioned in [1],
>> quote:
>>
>> "Referring to capture groups via numbers has several disadvantages:
>> 1. Finding the number of a capture group is a hassle: you have to
>> count parentheses.
>> 2. You need to see the regular expression if you want to understand
>> what the groups are for.
>> 3. If you change the order of the capture groups, you also have to
>> change the matching code."
>>
>> [1] http://2ality.com/2017/05/regexp-named-capture-groups.html
>
> looks like nice feature

Yes, it looks that this could allow the simplification of equivalent
queries, which I guess would use a CTE to achieve the same.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2018-02-03 15:14:32 Re: [HACKERS] GSoC 2017: Foreign Key Arrays
Previous Message Pavel Stehule 2018-02-03 12:55:31 Re: Regexp named capture groups