pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gilles Darold <gilles@darold.net>
To: pgsql-hackers@lists.postgresql.org
Subject: Re: [PATCH] proposal for regexp_count, regexp_instr, regexp_substr and regexp_replace
Date: Sun, 21 Mar 2021 10:21:17 +0100
Message-ID: <a508c358-5661-c97c-7edd-0ca39e0dfbb6@darold.net> (raw)
In-Reply-To: <2292303d-766d-2172-2942-b076a3bb6505@darold.net>
References: <fc160ee0-c843-b024-29bb-97b5da61971f@darold.net>
	<2292303d-766d-2172-2942-b076a3bb6505@darold.net>

Le 20/03/2021 à 19:48, Gilles Darold a écrit :
>
> Hi,
>
>
> This is a new version of the patch that now implements all the XQUERY
> regexp functions as described in the standard, minus the differences
> of PostgerSQL regular expression explain in [1].
>
>
> The standard SQL describe functions like_regex(), occurrences_regex(),
> position_regex(), substring_regex() and translate_regex() which
> correspond to the commonly named functions regexp_like(),
> regexp_count(), regexp_instr(), regexp_substr() and regexp_replace()
> as reported by Chapman Flack in [2]. All these function are
> implemented in the patch. Syntax of the functions are:
>
>
> - regexp_like(string, pattern [, flags ])
>
> - regexp_count( string, pattern [, position ] [, flags ])
>
> - regexp_instr( string, pattern [, position ] [, occurrence ] [,
> returnopt ] [, flags ] [, group ])
>
> - regexp_substr( string, pattern [, position ] [, occurrence ] [,
> flags ] [, group ])
>
> - regexp_replace(source, pattern, replacement [, position ] [,
> occurrence ] [, flags ])
>
>
> In addition to previous patch version I have added the regexp()_like
> function and extended the existsing regex_replace() function. The
> patch documents these functions and adds regression tests for all
> functions. I will add it to the commitfest.
>
>
> An other regexp functions regexp_positions() that returns all
> occurrences that matched a POSIX regular expression is also developped
> by Joel Jacobson, see [2]. This function expands the list of regexp
> functions described in XQUERY.
>
>
> [1]
> https://www.postgresql.org/docs/13/functions-matching.html#FUNCTIONS-POSIX-REGEXP
>
> [2]
> https://www.postgresql.org/message-id/flat/bf2222d5-909d-408b-8531-95b32f18d4ab%40www.fastmail.com#3...
>
>

I would like to see these functions in PG 14 but it is a bit too late,
added to commitfest 2021-07.


-- 
Gilles Darold
LzLabs GmbH
http://www.lzlabs.com/

view thread (28+ messages)  latest in thread

Message-ID: <a508c358-5661-c97c-7edd-0ca39e0dfbb6@darold.net>
Permalink:  ../a508c358-5661-c97c-7edd-0ca39e0dfbb6@darold.net/
Also on:    postgresql.org/message-id/a508c358-5661-c97c-7edd-0ca39e0dfbb6@darold.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: gilles@darold.net
  Subject: Re: [PATCH] proposal for regexp_count, regexp_instr, regexp_substr and regexp_replace
  In-Reply-To: <a508c358-5661-c97c-7edd-0ca39e0dfbb6@darold.net>
  References: <fc160ee0-c843-b024-29bb-97b5da61971f@darold.net> <2292303d-766d-2172-2942-b076a3bb6505@darold.net> <a508c358-5661-c97c-7edd-0ca39e0dfbb6@darold.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox