Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123751 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id D436F1A009C for ; Sat, 22 Jun 2024 17:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719076338; bh=04Ne82FcswvEMCxPGyuHBIyfbZgpGjGxarPEujhy2Ys=; h=Date:Subject:To:References:From:In-Reply-To:From; b=IgjSuM42lnV9e5AoP/r4pp1TYYkmFSMEyy8a/c9OO1uf5E+hyA5kmZBJw6cK5f6yN b+WsMWngJmz/2PugEo/bc8YIgxOck08gzhpECcIa7Y3WwxWhWNGLMkPybDCKDM1Anr 6KKKzDymU1AMUhoMT/a8wkLIxYJJP/SEFegV1NIGnMY0A0W9+A871D59h8HKqOO2o1 kjnBpiUFrc0MOcQgC5ruIxMb0dhechRngFVXKtPGKON6KtwnV8jXdlk5t3cBqswGAV vPGo6ZgGkLJpGLMWSn9dT9R9zgh9fvm/010G1SteNpOTZD4rAtIGKgKeewYHxijLbq tFusZ1m20ysMw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 867A91805EA for ; Sat, 22 Jun 2024 17:12:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh4-smtp.messagingengine.com (fhigh4-smtp.messagingengine.com [103.168.172.155]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 22 Jun 2024 17:12:15 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 0D17011400C2 for ; Sat, 22 Jun 2024 13:11:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 22 Jun 2024 13:11:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1719076260; x=1719162660; bh=+iX772gCxW DbMJYUZsQYCVyk/KymMUetn1vK+Rpd9Z4=; b=ikFO7LgFAQeTBj6ltK0VXuhXSG nkm1kNAxgqiY9MOcs9sKGlpjkjkAo8yLtSZg5c8QmGDkCrRT6urABja19HMT4rbl /at05ogt7Nr89fPGwO4Mn3wQGbhXuFoOCNATXYSJ9+nBGOUQxYbwQx70lf46I+Dk Mgp27ti5Ac5GnqG1GIg4QgDWsARz8LJ6BRXQ9CHYgyTnI+vLILD7neWFF2NiJyue N6vxY6ygY3u9fl0Y5QItFH3Cf9/zR+M6o3/SyZUj78h8GvwioCRPAYphbB3iG3vF PUjC9/IwSbKPzMYxMq2F6YJHZSdTubEvG5L96aDlRVFFvKdCLDGMcDrN9aBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1719076260; x=1719162660; bh=+iX772gCxWDbMJYUZsQYCVyk/Kym MUetn1vK+Rpd9Z4=; b=h32bFomevCNMXT5kr+5Q1nuUp3ecC1NMadriNzfgc86R v0eIZjylTA4iu0gh/oMr9dbe+nCBRhRf//gGpAeL/ySdMPsfhGc5ft6oDGOHr6Sr bRUylrai1tYEPFzxY5pxyHr74y2Cgn1OFAHEjvnS1Lx/8SzNsIj568S5LgPorONB lPxeuHAmljAbqWgLBT7GI5aQwnBtu10ZQmWm76dhlK992H79ws5A7i9zN14RhpdK M7JjqAq+1YNFvC3byr4HisW9PRLCTgpmIKw1w0W7Jyk+NRNTyOCVqzD9zHmmhhFA kQ74lKH2se+6uTSc+oE9giRMpJ8i1Oh8p+YOoBN9OQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeefiedgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtd erredtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdf uceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpe ehteelieeigfeuudeiueeiffdvveehudeufeekjeeugffffedtiedtgeettdelteenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprd hphhhpsehrfigvtgdrtghordhukh X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 22 Jun 2024 13:10:59 -0400 (EDT) Content-Type: multipart/alternative; boundary="------------fWWwPqeRSSopENIWX8Cr1bnO" Message-ID: <86cb8210-a5f5-44d1-9164-21b28aba68a0@rwec.co.uk> Date: Sat, 22 Jun 2024 18:10:58 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching To: internals@lists.php.net References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> <7ec12de5-b2f7-481c-acca-1b38f5be7deb@mabe.berlin> Content-Language: en-GB In-Reply-To: From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") This is a multi-part message in MIME format. --------------fWWwPqeRSSopENIWX8Cr1bnO Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 21/06/2024 19:03, Larry Garfield wrote: >> * Regex pattern >> >> This one is interesting as well ... but I would expect native regex >> syntax first before introducing it as part of a different RFC. Similar >> as generics. > Named capture groups are already part of regex syntax, just not often used. The example is not introducing anything new there. (Although Ilija tells me it may be hard to implement, so it may get postponed anyway. TBD.) I think what Marc means is that it's weird to see the regex syntax outside of a quoted string, since we don't currently have that syntax defined in PHP. It's not even clear what the constraints of that syntax would be; for instance, this is valid PHP: $result = preg_match(subject: $string, pattern: "# (int|string) /*(.*/) #xi"); But I'm guessing it would be a challenge to parse this: $result = $string is # (int|string) /*(.*/) #xi; The simple answer is probably to use a more limited syntax, but defining that syntax probably deserves its own discussion. -- Rowan Tommins [IMSoP] --------------fWWwPqeRSSopENIWX8Cr1bnO Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 21/06/2024 19:03, Larry Garfield wrote:
* Regex pattern

This one is interesting as well ... but I would expect native regex 
syntax first before introducing it as part of a different RFC. Similar 
as generics.
Named capture groups are already part of regex syntax, just not often used.  The example is not introducing anything new there.  (Although Ilija tells me it may be hard to implement, so it may get postponed anyway.  TBD.)


I think what Marc means is that it's weird to see the regex syntax outside of a quoted string, since we don't currently have that syntax defined in PHP. 

It's not even clear what the constraints of that syntax would be; for instance, this is valid PHP:

$result = preg_match(subject: $string, pattern: "#
(int|string)
/*(.*/)
#xi");

But I'm guessing it would be a challenge to parse this:

$result = $string is #
(int|string)
/*(.*/)
#xi;

The simple answer is probably to use a more limited syntax, but defining that syntax probably deserves its own discussion.


-- 
Rowan Tommins
[IMSoP]
--------------fWWwPqeRSSopENIWX8Cr1bnO--