Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijQOM-0004PM-8K for pgsql-general@arkaria.postgresql.org; Mon, 23 Dec 2019 16:17:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ijQOL-0001fQ-01 for pgsql-general@arkaria.postgresql.org; Mon, 23 Dec 2019 16:17:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijQOK-0001fJ-Il for pgsql-general@lists.postgresql.org; Mon, 23 Dec 2019 16:17:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ijQOE-0002Vm-2q for pgsql-general@postgresql.org; Mon, 23 Dec 2019 16:17:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBNGGwk1009598; Mon, 23 Dec 2019 11:16:58 -0500 From: Tom Lane To: "Daniel Verite" cc: pgsql-general@postgresql.org Subject: Re: Mixing greediness in regexp_matches In-reply-to: <90347d36-4b3c-4806-bd99-e5fae2cfad71@manitou-mail.org> References: <90347d36-4b3c-4806-bd99-e5fae2cfad71@manitou-mail.org> Comments: In-reply-to "Daniel Verite" message dated "Mon, 23 Dec 2019 17:10:41 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9596.1577117818.1@sss.pgh.pa.us> Date: Mon, 23 Dec 2019 11:16:58 -0500 Message-ID: <9597.1577117818@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Daniel Verite" writes: > FWIW, in plperl, there's a simple solution: > $string =~ s/(foobar|foo|...)/$replace{$1}/g Well, our manual does suggest using plperl (or pltcl) when the built-in pattern match functions aren't adequate ;-) regards, tom lane