Re: change regexp_substr first argument make tests more easier to understand.

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: change regexp_substr first argument make tests more easier to understand.
Date: 2023-12-28 07:17:00
Message-ID: CACJufxGiE0tuWioYgMvRCtd8J4RhqRK+pXCQQEEZkWdqRmwKJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 28, 2023 at 12:13 AM jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>
> hi.
> https://git.postgresql.org/cgit/postgresql.git/tree/src/test/regress/expected/strings.out#n928
>
> SELECT regexp_substr('abcabcabc', 'a.c');
> SELECT regexp_substr('abcabcabc', 'a.c', 2);
> SELECT regexp_substr('abcabcabc', 'a.c', 1, 3);
> SELECT regexp_substr('abcabcabc', 'a.c', 1, 4) IS NULL AS t;
> SELECT regexp_substr('abcabcabc', 'A.C', 1, 2, 'i');
>
> they all return 'abc', there are 3 'abc ' in string 'abcabcabc'
> except IS NULL query.
> maybe we can change regexp_substr first argument from "abcabcabc" to
> "abcaXcaYc".
> so the result would be more easier to understand.

anyway here is the minor patch to change string from "abcabcabc" to
"abcaXcaYc".

Attachment Content-Type Size
v1-0001-make-regex-result-more-easier-to-understand.patch text/x-patch 2.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2023-12-28 07:34:00 Re: Functions to return random numbers in a given range
Previous Message Michael Paquier 2023-12-28 06:37:16 Re: doc patch: note AttributeRelationId passed to FDW validator function