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 D207B1F44D for ; Wed, 17 Apr 2024 15:58:21 +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=U5mxRx5p; 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=lO3V1ypd; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id B13978440F; Wed, 17 Apr 2024 15:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1713369493; bh=o51CeiSx1gt4pByr3jynp0GzYuX30TjCKFWdIUooPjc=; 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=U5mxRx5pieA1vNGJPHV8BZdfRxxzqbWoF3SpYEvHKz0rl7N5vQobGUh0uivhmlkij GiwTE0RUs0O5iqUQaMzCNz1pm/TSBARSQPuwdsLxJzGQKEB1JgVSFnV3IxBPOROH4p vxaua3JJz0Gi1kt5Id4ynEco7tWKJeniTqRsy4rQ= Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) by nue.mailmanlists.eu (Postfix) with ESMTPS id CCFC47D642 for ; Wed, 17 Apr 2024 15:58:09 +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=lO3V1ypd; 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=vpQnrM0bVHgdgSaO1Brs5bECSw3mPWYR3bHpHX11Sro=; b=lO3V1ypdR54iurOOHxkHLhfnrhA07KgAHk6GVaRvlJNtn0M39CvBuhAvqt9IfE+8n5rT irxD4mnocZ1UaiByUfm6V5DCzICdlBkzyvR+gDZN2GB2GfqmE1nWErKgAt1XCfBkQiWKUd eHUmO+MrztkNbcn/Df/VLvrWoCByaLmdPqofL6cqvD8EXBrn7WNT1sY50OcetEerwuYKKm lH2mmToctlzEhCvaK+nZ7kvjoOlkKsIKgN06IKFc4nKbLCosU5v//WvrKO1rkPhpbwG3ki guvq1tXFAhuZO06a1++kV6sCNHgI4/2Ao5kbjgzwxaiT3ls+zNAPKyWmz8GuXh+w== Received: by recvd-6b888cd74b-k8brp with SMTP id recvd-6b888cd74b-k8brp-1-661FF18F-1B 2024-04-17 15:58:07.834391104 +0000 UTC m=+410296.984125733 Received: from herokuapp.com (unknown) by geopod-ismtpd-32 (SG) with ESMTP id E97nHLBhSFGcIKQS6er_Ug for ; Wed, 17 Apr 2024 15:58:07.763 +0000 (UTC) Date: Wed, 17 Apr 2024 15:58:07 +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: kddnewton 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: 94164 X-SG-EID: =?us-ascii?Q?u001=2E41nWPij=2FD1kdGmpgWeHScbb9X8tZePZrQQx3bl8Vy2odBuMhLMhId2kIq?= =?us-ascii?Q?I4MmMJ43lNHfKPNNds=2Fb3JsTYpYoWyQb3+sPV4d?= =?us-ascii?Q?vscaSKwkBzU6ahNzoUEni+4y9w+ZTlOFOebTm2x?= =?us-ascii?Q?TNKvLaoflQ1yenBT6yH9omgX+rXY=2F5c4F=2F4cNYg?= =?us-ascii?Q?KU6WGUvNOBtX4EJiDdIrBvSrN6KwE0QRBbO+6jT?= =?us-ascii?Q?qAKv2y4n8WV7wZzsyEhOfRHFUGxH7=2F35FzyjUgF?= =?us-ascii?Q?We0QP511ePmTxRzNAGfp=2FpcmdA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: CGJQYIINDD7IUTU3GFDAPHE6W6236IIQ X-Message-ID-Hash: CGJQYIINDD7IUTU3GFDAPHE6W6236IIQ 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:117568] [Ruby master Misc#20434] Deprecate regular expression modifiers List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "kddnewton (Kevin Newton) via ruby-core" Cc: "kddnewton (Kevin Newton)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20434 has been reported by kddnewton (Kevin Newton). ---------------------------------------- Misc #20434: Deprecate regular expression modifiers https://bugs.ruby-lang.org/issues/20434 * 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/