From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 8722F1F44D for ; Thu, 18 Apr 2024 00:24:12 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=IhL8p+sS; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=kOYCjVt8; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id C2A9C84355; Thu, 18 Apr 2024 00:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1713399844; bh=W5HqflloZoEGDd2hB8xGI+zXBG0P2OVXKuRKiRpM64U=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=IhL8p+sSi/2BGTuK6TaNOQ0J401uEUgqNVdWrT1EUzZtvNGcu0atd1PyWu+RetPAg HUJayYQ694a4Y1eQToM1QjkWPTLjosdsazH9K15/SMDofffIOf0dUMoqvjzgSm6iJw oFt5RsmV6nha8HGonOXewEtDeX88pUsIZgUxYJ6g= Received: from s.wrqvtzvf.outbound-mail.sendgrid.net (s.wrqvtzvf.outbound-mail.sendgrid.net [149.72.126.143]) by nue.mailmanlists.eu (Postfix) with ESMTPS id E31C184317 for ; Thu, 18 Apr 2024 00:24:00 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=kOYCjVt8; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=v9fHbRAA3td5+OtLgj/OnlgHBUK1AKTcCOWCdt68BRA=; b=kOYCjVt8JqggrzPEA87lQGj6f/Lu4zaJrh450ttxR6XApBOc4TPHUGaSq+A3K1NQI5Wk mb9M8EzilW+9HDkYvq0OwIYjPn1H3C94BvCgHjKu7nOomJYwJ1SUSITWhf1JOSbemxWYSE O6p8hJxxjsYW2GCinTnZvoRy8md/n+BSbCP0o1Kza5nnklYEg8juyQbS+7aSi7WahnYUD1 sXcpUS4OjNGe1ONsm/VIDJlvXJBkfq0wYqbNDTPZDxQTx29/0Z/SbjQdfNKEUbRRXxo9rM AHod02S4QEwMue+FsoRnCmbWEtfZOSgeR7BUzHDHrfORPngJlzeyz++WU5/CCBKg== Received: by filterdrecv-854b845bd5-m9fgv with SMTP id filterdrecv-854b845bd5-m9fgv-1-6620681F-7 2024-04-18 00:23:59.605979751 +0000 UTC m=+441274.513730120 Received: from herokuapp.com (unknown) by geopod-ismtpd-12 (SG) with ESMTP id czj4cLj9TrObZsGTysXPgA for ; Thu, 18 Apr 2024 00:23:59.468 +0000 (UTC) Date: Thu, 18 Apr 2024 00:23:59 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Misc X-Redmine-Issue-Id: 20434 X-Redmine-Issue-Author: kddnewton X-Redmine-Issue-Priority: Normal X-Redmine-Sender: shyouhei X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 94177 X-SG-EID: =?us-ascii?Q?u001=2EYb+gxajettXtIRRbovldwe1q9pj4BbUVLgkglfGACSriEdKOm=2FiYoqOLj?= =?us-ascii?Q?03lPXujlro4oiTXwkRMLtmbf5mY+2Uv33JJiwU+?= =?us-ascii?Q?ZJeKxsg2=2FpY7NzrBSwE1y3uGcdELbo1BaKaXvOf?= =?us-ascii?Q?uGTpaQqsp7dxqzqSZ8FgemlVkAbBXL+tJuQ68kE?= =?us-ascii?Q?uQVid5CRni5IVGCqUyDtf9sjTvaDaDfpR7UWYwY?= =?us-ascii?Q?pmDA5Qe9wBDytHPDCSI4KwjjwUGIYd4zr4zr8oM?= =?us-ascii?Q?HvA5vrxmDa=2FE98xPBMqj7e72eA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: KUSVOHMZGYIT4BWLGF2Q7EDOG3CA7OZM X-Message-ID-Hash: KUSVOHMZGYIT4BWLGF2Q7EDOG3CA7OZM X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:117581] [Ruby master Misc#20434] Deprecate encoding-releated regular expression modifiers List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "shyouhei (Shyouhei Urabe) via ruby-core" Cc: "shyouhei (Shyouhei Urabe)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20434 has been updated by shyouhei (Shyouhei Urabe). Subject changed from Deprecate regular expression modifiers to Deprecate encoding-releated regular expression modifiers +1 for deprecating encoding modifiers, but they're not everything that a regexp can take. For instance `/foo/i` is a valid regular expression literal in ruby, perl, PHP(preg), and Javascript. I'm sure Kevin didn't intend to kill everything. Let me narrow the scope of this request; subject updated. ---------------------------------------- Misc #20434: Deprecate encoding-releated regular expression modifiers https://bugs.ruby-lang.org/issues/20434#change-107981 * Author: kddnewton (Kevin Newton) * Status: Open ---------------------------------------- This is a follow-up to @duerst's comment here: https://bugs.ruby-lang.org/issues/20406#note-6. As noted in the other issue, there are many encodings that factor in to how a regular expression operates. This includes: * The encoding of the file * The encoding of the string parts within the regular expression * The regular expression encoding modifiers * The encoding of the string being matched At the time the modifiers were introduced, I believe the modifiers may have been the only (??) encoding that factored in here. At this point, however, they can lead to quite a bit of confusion, as noted in the other ticket. I would like to propose to deprecate the regular expression encoding modifiers. Instead, we could suggest in a warning to instead create a regular expression with an encoded string. For example, when we find: ```ruby /\x81\x40/s ``` we would instead suggest: ```ruby ::Regexp.new(::String.new("\x81\x40", encoding: "Windows-31J")) ``` or equivalent. As a migration path, we could do the following: 1. Emit a warning to change to the suggested expression 2. Change the compiler to compile to the suggested expression when those flags are found 3. Remove support for the flags Step 2 may be unnecessary depending on how long of a timeline we would like to provide. To be clear, I'm not advocating for any particular timeline, and would be fine with this being multiple years/versions to give plenty of time for people to migrate. But I do think this would be a good change to eliminate confusion about the interaction between the four different encodings at play. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/