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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [IPv6:2a01:4f8:1c0c:6b10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 379571F406 for ; Wed, 27 Dec 2023 12:16:06 +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=mA9HnL2o; 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=Xm9kQA03; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 1466481A26; Wed, 27 Dec 2023 12:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1703679359; bh=qrCgM0gd5VvpGsFq8NrZe74PZlKddZhmA6ze6JD2r1E=; 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=mA9HnL2oV+H5bOwkq3tv07zYhTiVmEz7ipdXnQXYNw0bpMCXmQCO4j2dEzvCG7oVL 6U3SKAKHdpNc+CsNv5nzJxY8evpL2H0WaN6s58anSroxl+a5JR4N0OHIWbZiLJ5W9k 53mgjKlwPGFPtZwSE0c0NJMNOFazagGuqvwm0UZw= Received: from wrqvtvvn.outbound-mail.sendgrid.net (wrqvtvvn.outbound-mail.sendgrid.net [149.72.120.130]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 422BE81A23 for ; Wed, 27 Dec 2023 12:15:56 +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=Xm9kQA03; 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=gRo84egCpC5S6SJjW+2cLBOIx70QOCH0i64g6EpFSf4=; b=Xm9kQA03Gj9BPqeAa4mqy02STdtITJPfyDbbyioDrLD3KBfx56piPaWwUdJgq0TtmPG8 BPZZ2dSDSeWu98q3M+VSr9PSEgFtPasifQHhFIIhs8aY+ocj9d0dgZ7pU1+3aL9VRE5VKK zF9Vb0ZgpmNJiMT3M5V2GPn6PYjjCeerKZLy/vlsumDoXinSj+loU31avNCp/HtBrle9MX 1TqP965nT+ri5pxKDs6YlnErUsrhDOa+/HA+Jz2IHjv6UYPWTYU63f3oZsTePtYmNumR0x S0dQjB/o2z6iQj89jz3OkHc//ozspuufYHqHoOgAIIUhqtSdqGhb1r2vKCj5ewTw== Received: by filterdrecv-canary-56969bcbff-lvshc with SMTP id filterdrecv-canary-56969bcbff-lvshc-1-658C157A-2F 2023-12-27 12:15:54.945712444 +0000 UTC m=+1368759.868151390 Received: from herokuapp.com (unknown) by geopod-ismtpd-11 (SG) with ESMTP id ITAjk-uBQMeMzPbGFln-BQ for ; Wed, 27 Dec 2023 12:15:54.936 +0000 (UTC) Date: Wed, 27 Dec 2023 12:15:54 +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-Sender: tompng 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: 92464 X-SG-EID: =?us-ascii?Q?ilfyla8uzFYJVSHYytdBs7FEchejsTrQ6=2Fd0Pk8jjPPaQR9Zwfnyp+Knr7=2FgeO?= =?us-ascii?Q?bH3H114RihAMx2NoHkBXQShjr8NJxn4ib3gAguk?= =?us-ascii?Q?0NxO76mOil8UPMs6yNLPErQdCyawl8GoITT6MRB?= =?us-ascii?Q?aiRp6l3OVrWSZLE4CHbxd=2FSgeQ09IxF=2Fjz4Psml?= =?us-ascii?Q?NIpJ1ag3sjR=2F9+YkRh0wIRqQs+J+ccBkaacykLx?= =?us-ascii?Q?AuGewVf3O0GU5uN3K6ip8GCjbp8nUPgVxapefl0?= =?us-ascii?Q?=2FrqGKCX6KhTBLBaQn9Mvw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: PMCJOGFHXJO4DH4T6F5IUI3XRPXWDXZI X-Message-ID-Hash: PMCJOGFHXJO4DH4T6F5IUI3XRPXWDXZI 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:115933] [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: "tompng (tomoya ishida) via ruby-core" Cc: "tompng (tomoya ishida)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20098 has been reported by tompng (tomoya ishida). ---------------------------------------- Bug #20098: Wrong regexp match in ruby 3.2 and 3.3 https://bugs.ruby-lang.org/issues/20098 * Author: tompng (tomoya ishida) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +MN [arm64-darwin22] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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/