public inbox for [email protected]
help / color / mirror / Atom feedFrom: Bruce Momjian <[email protected]>
To: Tom Lane <[email protected]>
Cc: PostgreSQL-documentation <[email protected]>
Subject: Re: regexp_replace 'g' flag
Date: Fri, 31 Jan 2014 22:40:18 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-docs>
On Thu, Sep 5, 2013 at 09:59:13PM -0400, Tom Lane wrote:
> Bruce Momjian <[email protected]> writes:
> > On Thu, Sep 5, 2013 at 08:37:44PM -0400, Bruce Momjian wrote:
> >> Why doesn't the 'g' flag appear in this table?
> >> http://www.postgresql.org/docs/9.2/static/functions-matching.html#POSIX-EMBEDDED-OPTIONS-TABLE
>
> > Is it because the table has generic pattern modififers and 'g' only is
> > relevant for regexp_replace? I assume so.
>
> The table is specifically about ARE options, and 'g' is *not* one of
> those. Adding 'g' to the table would be wrong.
>
> It does seem to me to be a bit confusing that the text description of
> substring() mentions 'i' and 'g' explicitly, when only 'i' is listed in
> the table. You could make a case for phrasing along the line of
> "substring() supports the 'g' flag that specifies ..., as well as all the
> flags listed in Table 9-19". On the other hand, 'i' is the most useful of
> the flags listed in the table by several country miles, and it doesn't
> seem quite right to make people go off and consult the table to find out
> about it.
>
> Not sure whether there's any real improvement that can be made here,
> but I suppose it'd be nice if the text descriptions of substring() and
> regexp_replace() handled this matter in the same way ...
I went ahead and just explicitly documented that 'g' is not in the
table.
--
Bruce Momjian <[email protected]> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +
--
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
Attachments:
[text/x-diff] regex.diff (1.3K, 2-regex.diff)
download | inline diff:
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 9c2708c..252539f 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -3984,7 +3984,8 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
string containing zero or more single-letter flags that change the
function's behavior. Flag <literal>i</> specifies case-insensitive
matching, while flag <literal>g</> specifies replacement of each matching
- substring rather than only the first one. Other supported flags are
+ substring rather than only the first one. Supported flags (though
+ not <literal>g</>) are
described in <xref linkend="posix-embedded-options-table">.
</para>
@@ -4021,8 +4022,9 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g')
string containing zero or more single-letter flags that change the
function's behavior. Flag <literal>g</> causes the function to find
each match in the string, not only the first one, and return a row for
- each such match. Other supported
- flags are described in <xref linkend="posix-embedded-options-table">.
+ each such match. Supported flags (though
+ not <literal>g</>)
+ are described in <xref linkend="posix-embedded-options-table">.
</para>
<para>
view thread (5+ messages)
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: regexp_replace 'g' flag
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox