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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 6FB911F44D for ; Sun, 31 Mar 2024 08:32:23 +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=hQRwlEyA; 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=fnRkKC8h; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id EC68283ACE; Sun, 31 Mar 2024 08:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1711873934; bh=Nm1vcFPJCEbf0HTI1uZnFw1axP/tKBoZvj+oxB6j5Dc=; 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=hQRwlEyA/BaIC0efF6rYfUOWDx2E3qqKprpyBh7VYG9MADIzWIt6/PuBtw/MVwJGV j70urP+zYWishoBpvLAC2/Bh4VdJ7R+QBz2C9wlioNDzpMA7snLk9BazgWvspr2rXq cO31ST4ISfKK9eIruUV+2TFoTHlMREJmFocMxhFA= Received: from s.wfbtzhsw.outbound-mail.sendgrid.net (s.wfbtzhsw.outbound-mail.sendgrid.net [159.183.224.105]) by nue.mailmanlists.eu (Postfix) with ESMTPS id B795783AC3 for ; Sun, 31 Mar 2024 08:31:47 +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=fnRkKC8h; 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=jfYRwFrTKU860m4bTPkSGgb8BN0+1wXrAYDdw4+n61o=; b=fnRkKC8hzksbgd2dBpONcgQIue0YLAEm9N/wsnLdK6T7UoZnXF0NV3u3LY0Dqdx9SYiK 1aVaPBdaJwsXp4K7Xk2yCLbN8A7sEAFoVuk+5rhjQ/KIqMYFnTKb2cN6UyH9kFxmAIpht0 T0/mwO2owP4aAXGSTo+n29AwE1W1eX5qDGa9eo8aj7cy85N/RJgrgJ2r3tILVYcE/VaU52 hP/S8j65EV0S5YuHDduPx8kNkpMobfiBdxiBy6wqYoOKiJmWjIiftaC4RZ0U5otkD3q0iw XDPjxjZbg6nKlnWVSYBNu3HtYykRXUw6rtFJlHYTLEUm9mMY1yrIo8M+q5HHpShg== Received: by recvd-57769bb547-vn9rc with SMTP id recvd-57769bb547-vn9rc-1-66091F71-18 2024-03-31 08:31:45.813976439 +0000 UTC m=+1078226.764834273 Received: from herokuapp.com (unknown) by geopod-ismtpd-20 (SG) with ESMTP id BMEqf8KwSVqUBssPuN9xXA for ; Sun, 31 Mar 2024 08:31:45.759 +0000 (UTC) Date: Sun, 31 Mar 2024 08:31:45 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20098 X-Redmine-Issue-Author: tompng X-Redmine-Issue-Priority: Normal X-Redmine-Sender: nagachika 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: 93977 X-SG-EID: =?us-ascii?Q?u001=2E44VQVH0G4ktThU9FFZyDXb=2FoLGKi0xg3KhKXpO+IAEE5wRGZS=2FaUmrCxU?= =?us-ascii?Q?vRSr0kI+o91vm0PKZJNpskxVPGLEUY0z2=2FFYkjb?= =?us-ascii?Q?KjL91GsNRUCvgh=2FGwFcCmlFe4HRggypKmdnReyQ?= =?us-ascii?Q?75irfPHvyYYjn4rpwKtKbeWcdiyhYhxoU22HKFO?= =?us-ascii?Q?u05Nu606qTFlSILNU0akzvwBqZFlt6ajm7AxSXO?= =?us-ascii?Q?KL6MXbQOjnmZtddqG44674=2FIqcOXBE8I5yYN5wP?= =?us-ascii?Q?DuFB3fKZCjy0AjIIbD9aQjeOmg=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 6WEJARVAGNPCLBEFUZ2VRBXBJZXULYRL X-Message-ID-Hash: 6WEJARVAGNPCLBEFUZ2VRBXBJZXULYRL 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:117382] [Ruby master Bug#20098] Wrong regexp match in ruby 3.2 and 3.3 List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "nagachika (Tomoyuki Chikanaga) via ruby-core" Cc: "nagachika (Tomoyuki Chikanaga)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20098 has been updated by nagachika (Tomoyuki Chikanaga). The changeset bb59696614083660241ef272f222628cbfa95844 cannot be merged into ruby_3_2 branch cleanly and hard to me to write a patch. @tompng Could you kindly create the patch for ruby_3_2 branch? ---------------------------------------- Bug #20098: Wrong regexp match in ruby 3.2 and 3.3 https://bugs.ruby-lang.org/issues/20098#change-107543 * Author: tompng (tomoya ishida) * Status: Closed * ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +MN [arm64-darwin22] * Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED, 3.3: DONE ---------------------------------------- These regexp all matches in ruby 3.1.4, but not in ruby 3.3.0. ~~~ruby p /a((.|.)|bc){,4}z/.match? 'abcbcbcbcz' p /a(b+?c*){4,5}z/.match? 'abbbccbbbccbcbcz' # matches in ruby 3.2.2 p /a(b+?(.|.)){2,3}z/.match? 'abbbcbbbcbbbcz' p /a(b*?(.|.)[bc]){2,5}z/.match? 'abcbbbcbcccbcz' ~~~ Adding backref (to disable optimization) makes them match. ~~~ruby p /()\1a((.|.)|bc){,4}z/.match? 'abcbcbcbcz' p /()\1a(b+?c*){4,5}z/.match? 'abbbccbbbccbcbcz' p /()\1a(b+?(.|.)){2,3}z/.match? 'abbbcbbbcbbbcz' p /()\1a(b*?(.|.)[bc]){2,5}z/.match? 'abcbbbcbcccbcz' ~~~ Found in this script https://gist.github.com/tompng/aa0706a181e9187bd79e8cec5a5f3c97 -- 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/