Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1frkWD-0008Ii-Q3 for pgsql-general@arkaria.postgresql.org; Mon, 20 Aug 2018 13:46:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1frkWC-00077h-12 for pgsql-general@arkaria.postgresql.org; Mon, 20 Aug 2018 13:46:52 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1frkWB-00077Z-M3 for pgsql-general@lists.postgresql.org; Mon, 20 Aug 2018 13:46:51 +0000 Received: from esa19.hc49497.c3s2.iphmx.com ([216.71.158.23]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1frkW8-0001z5-9p for pgsql-general@lists.postgresql.org; Mon, 20 Aug 2018 13:46:50 +0000 IronPort-PHdr: =?us-ascii?q?9a23=3ACPwJ5hGeDYqA5zszO5qI9Z1GYnF86YWxBRYc79?= =?us-ascii?q?8ds5kLTJ7yrsywAkXT6L1XgUPTWs2DsrQY07SQ6/iocFdDyK7JiGoFfp1IWk?= =?us-ascii?q?1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBA?= =?us-ascii?q?j0OxZrKeTpAI7SiNm82/yv95HJbAhEmDuwbaluIBmqsA7cqtQYjYx+J6gr1x?= =?us-ascii?q?DHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PG?= =?us-ascii?q?Au+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VD?= =?us-ascii?q?K/5KlpVRDok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?q?dijudBEZpU/fwaaAoiMY/gyLkuE9fpRg3bc8yQTH65S9GiCHc6SZQwx4ldTV?= =?us-ascii?q?x6HoCEjxvAlwawBPdBj7uQGJMu/7nF21DuLsJ5wjDN0+8giw91EYN0KWS6i/?= =?us-ascii?q?snpEDoDInTnhDBmg=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2HDDgAwxXpb/2B/0jRbHAEBAQQBAQoBAYJogUojXCiDc?= =?us-ascii?q?YhpizwBgj8BiChkhC6IPYFmKoERggWBMQQCIIMvIjcVAQIBAQEBAQECAQECa?= =?us-ascii?q?RwMgjUigUVfUwETMyMZAhoCGA4CLg0TEhIIgxuBaAEBAggQDIojmlsBAW6BL?= =?us-ascii?q?oRZD4FsHgkdBSF0giQFgQuIJHmBB4MLZAcugxsEgSwBCwcBgyAxgiYCiAmFa?= =?us-ascii?q?4RMiDwJj2AVjjiCBY4SAYRnIyY7cTMag1yGAYpVPDCMUg8XgiMBAQ?= X-IronPort-AV: E=Sophos;i="5.53,265,1531814400"; d="scan'208,217";a="150636503" Received: from ec2-52-210-127-96.eu-west-1.compute.amazonaws.com (HELO 8df6168f8152.walla.co.il) ([52.210.127.96]) by ob1.hc49497.c3s2.iphmx.com with ESMTP; 20 Aug 2018 05:46:43 -0800 Received: by 8df6168f8152.walla.co.il (Postfix, from userid 33) id 7D0C063035; Mon, 20 Aug 2018 13:46:43 +0000 (UTC) To: pgsqladmin@geoff.dj, ken.tanzer@gmail.com, pgsql-general@lists.postgresql.org Subject: =?UTF-8?B?UkU6ICBSZTogUmU6IEFsbG93IFJlZyBFeHByZXNzaW9ucyBpbiBQb3NpdGlvbiBmdW5jdGlvbg==?= X-PHP-Originating-Script: 0:mail.php MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provider: walla.mail/v From: =?UTF-8?B?TmljayBEcm8=?= Date: Mon, 20 Aug 2018 16:46:42 +0300 Reply-To: Message-Id: <^22D695F5F6F276172F0625A5685FD68B121B2ACB@walla.co.il> Cc: , =?UTF-8?B?PHBnc3FsLWdlbmVyYWxAbGlzdHMucG9zdGdyZXNxbC5vcmc+?= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk

Hi,
My specific issue is alrady solved.
For the greater good I sent the email requesting to allow = reg exp in the position functions.
Not sure if you will implement it... Just wanted to let yo= u know that the limited capabilities of this function create overhead.

=D7=91 =D7=90=D7= =95=D7=92=D7=B3 20, 2018 14:35, Geoff Winkless =D7=9B=D7=AA=D7=91:
On Mon, 20 Aug 2= 018 at 09:22, Nick Dro <postgr= esql@walla.co.il> wrote:

This incorrect.
SELECT position(substring('https://www.webexample.com/s/help?' FR= OM '/(s|b|t)/') IN 'https://www.webexample.com/s/help?');
 
Gives 5. It's wrong.
<= div>


On Mon, 20 Aug 2018 at 09:22, Nick Dro= <postgresql@walla.co.il&g= t; wrote:
<= br>
This incorrect.
SELECT position(s= ubstring('= https://www.webexample.com/s/help?' FROM '/(s|b|t)/') IN 'https://www.webexamp= le.com/s/help?');
 
Gi= ves 5. It's wrong.

For some reason, substring() retur= ns the parenthesised subexpression rather than the top level..

The comment in testregexsubstr does say that it does th= is, but it's not clear from the documentation at all, unless I'm missing wh= ere it says it.

You can work around this by= putting parentheses around the whole expression, because that way the firs= t subexpression is the whole match.

db= =3D# SELECT position(substring('https://www.webexample.com/s/help?' FROM '(/(s|b|t)/)') IN 'https://www.webexample.com/s/help?= ');
 position
----------
  &nbs= p;    27

Geoff