pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: troy@frericks.us
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Manua correction
Date: Tue, 20 Jul 2021 16:06:17 -0400
Message-ID: <20210720200617.GA27025@momjian.us> (raw)
In-Reply-To: <400208.1626793389@sss.pgh.pa.us>
References: <162614304115.701.2392941350859387646@wrigleys.postgresql.org>
	<20210715213623.GC14027@momjian.us>
	<3701102.1626405158@sss.pgh.pa.us>
	<20210719142355.GA12687@momjian.us>
	<400208.1626793389@sss.pgh.pa.us>

On Tue, Jul 20, 2021 at 11:03:09AM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > I really don't understand the use of "(s)" except in place where we are
> > really trying to point out the idea of one or multiple, and I don't see
> > that being significant in these cases --- can you clarify?
> 
> See the example given for regexp_match:
> 
> regression=# select regexp_match('foobarbequebaz', '(bar)(beque)'); 
>  regexp_match 
> --------------
>  {bar,beque}
> (1 row)
> 
> There's more than one parenthesized subpattern, so you get more than
> one substring in the result.  So I think that change is flat out
> wrong.
> 
> The places where you changed "substring(s)" to "substrings" are maybe
> not flat wrong, but I don't think they're improving the text either.
> IIRC, in most of them you get one match if you didn't use the 'g'
> flag, but possibly multiple matches if you did, and the "substring(s)"
> wording is meant to allude to that without taking the space to spell
> it out explicitly.

I see what you mean --- there can be multiple capture groups, and
multiple match processing if 'g' is used.  I think the text using "(s)"
is too complex, so I spelled out the use 'g' and clarified the case of
multiple groups in a single regex.

Updated patch attached, and I used a larger line context around the
changes to clarify what was being modified.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.

Attachments:

  [application/gzip] substring.diff.gz (1.8K, ../20210720200617.GA27025@momjian.us/2-substring.diff.gz)
  download

view thread (7+ messages)  latest in thread

Message-ID: <20210720200617.GA27025@momjian.us>
Permalink:  ../20210720200617.GA27025@momjian.us/
Also on:    postgresql.org/message-id/20210720200617.GA27025@momjian.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, troy@frericks.us, pgsql-docs@lists.postgresql.org
  Subject: Re: Manua correction
  In-Reply-To: <20210720200617.GA27025@momjian.us>

* 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