From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add assorted new regexp_xxx SQL functions.
Date: Tue, 03 Aug 2021 17:09:03 +0000
Message-ID: <E1mAxuZ-0005mu-Oo@gemulon.postgresql.org> (raw)
Add assorted new regexp_xxx SQL functions.
This patch adds new functions regexp_count(), regexp_instr(),
regexp_like(), and regexp_substr(), and extends regexp_replace()
with some new optional arguments. All these functions follow
the definitions used in Oracle, although there are small differences
in the regexp language due to using our own regexp engine -- most
notably, that the default newline-matching behavior is different.
Similar functions appear in DB2 and elsewhere, too. Aside from
easing portability, these functions are easier to use for certain
tasks than our existing regexp_match[es] functions.
Gilles Darold, heavily revised by me
Discussion: https://postgr.es/m/fc160ee0-c843-b024-29bb-97b5da61971f@darold.net
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/6424337073589476303b10f6d7cc74f501b8d9d7
Modified Files
--------------
doc/src/sgml/func.sgml | 352 +++++++++++++++++++++++--
src/backend/utils/adt/regexp.c | 473 ++++++++++++++++++++++++++++++++--
src/backend/utils/adt/varlena.c | 33 ++-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 64 +++++
src/include/utils/varlena.h | 3 +-
src/test/regress/expected/strings.out | 371 ++++++++++++++++++++++++++
src/test/regress/sql/strings.sql | 89 +++++++
8 files changed, 1340 insertions(+), 47 deletions(-)
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-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Add assorted new regexp_xxx SQL functions.
In-Reply-To: <E1mAxuZ-0005mu-Oo@gemulon.postgresql.org>
References: <E1mAxuZ-0005mu-Oo@gemulon.postgresql.org>
* 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