Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rN0Lq-008USV-Ke for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2024 00:52:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rN0Lp-008b2n-7W for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2024 00:52:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rN0Ln-008b1w-AC for pgsql-hackers@lists.postgresql.org; Tue, 09 Jan 2024 00:52:16 +0000 Received: from out-170.mta0.migadu.com ([2001:41d0:1004:224b::aa]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rN0Lf-000ZHU-Um for pgsql-hackers@lists.postgresql.org; Tue, 09 Jan 2024 00:52:11 +0000 Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nmfay.com; s=key1; t=1704761522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kLjTSaYaoVHGCVGeoHYqmOSteY1Q3bFqTIObZmT3rK0=; b=FgO3NrOByWv+U5mS5/kqNxSFhX7z8n7mJU6eT6AQTrSbQoM9zMoS2niZ3+tHD6zsGl32qk 3rl4OzK47fM91hWfmtdZTlvJccbrSIYaiZTWMUXdwvuMF5/xnN6X+EFKELBdMovbXbTh/1 B99Ud1BrGgwuTw70DYW9X2gg3fhW6BOpZ2aUfS2NPibp/4Ivjvq72oqrN0T2n7jPpXYYTL 6fA4E9yf8pasfAbjLCB7bDx6ntjkvfuXcL6eCYj3Bypp1pR4+EUQIOkm3ZRX6U5/6qcPax abDX1kttkDX0GaJ/dL/DdATmXG+iCxE1fw61BWPNy6eoyoRBcZIwO5c+MKYHag== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 08 Jan 2024 19:51:58 -0500 Message-Id: Cc: "Jim Nasby" , "Peter Eisentraut" , "PostgreSQL Hackers" Subject: Re: add function argument names to regex* functions. X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Dian Fay" To: "jian he" References: <0eb3a5d7-75d8-4da5-9c88-a93deccdaa03@gmail.com> <75129a34-14da-48aa-9906-42062fe78664@gmail.com> In-Reply-To: X-Migadu-Flow: FLOW_OUT List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon Jan 8, 2024 at 9:26 AM EST, jian he wrote: > On Mon, Jan 8, 2024 at 8:44=E2=80=AFAM Dian Fay wrote: > > The `regexp_replace` summary in table 9.10 is mismatched and still > > specifies the first parameter name as `string` instead of `source`. > > Since all the other functions use `string`, should `regexp_replace` do > > the same or is this a case where an established "standard" diverges? > > got it. Thanks for pointing it out. > > in functions-matching.html > if I change source to > string then > there are no markup "string" and markup "string", it's kind of > slightly confusing. > > So does the following refactored description of regexp_replace make sense= : > > The string is returned unchanged if > there is no match to the pattern. If the= re is a > match, the string is returned with the > replacement string substituted for the ma= tching > substring. The replacement string can co= ntain > \n, where > n is 1 > through 9, to indicate that the source substring matching the > n'th parenthesized subexpression of > the pattern should be > inserted, and it can contain \& to indicate t= hat the > substring matching the entire pattern should be inserted. Write > \\ if you need to put a literal backslash in > the replacement > text. That change makes sense to me! I'll see about the section refactoring after this lands.