From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 865FC1F461 for ; Mon, 8 Jul 2019 01:08:00 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 878C21209D0; Mon, 8 Jul 2019 10:07:54 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id CE42812091F for ; Mon, 8 Jul 2019 10:07:52 +0900 (JST) Received: by filter0036p3las1.sendgrid.net with SMTP id filter0036p3las1-27808-5D22976A-1A 2019-07-08 01:07:54.477666458 +0000 UTC m=+364516.171323962 Received: from herokuapp.com (unknown [35.175.150.18]) by ismtpd0029p1mdw1.sendgrid.net (SG) with ESMTP id RyMnPqvvRQK4VLLmanZYeg for ; Mon, 08 Jul 2019 01:07:54.482 +0000 (UTC) Date: Mon, 08 Jul 2019 01:07:54 +0000 (UTC) From: merch-redmine@jeremyevans.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 69094 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 10891 X-Redmine-Issue-Author: tom-lord X-Redmine-Issue-Assignee: naruse X-Redmine-Sender: jeremyevans0 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-SG-EID: =?us-ascii?Q?RVE3t853K5scBhbmJHUzZTFFeVC=2FZSUmHZ0Dc+26wcEi2CTgsF1oz0wTSSxGGN?= =?us-ascii?Q?BI96fhqXcZWraOJ2ZTg+rpOLuO=2FCe7s=2F23FIpV8?= =?us-ascii?Q?0Bx5fNNNSiGypgK+7pcHgbEj=2FQzLJBnF1J5Sn5h?= =?us-ascii?Q?=2FbVw+LkOE6FgaH2eknlUlsznYHX=2F8WPxGQUuFhi?= =?us-ascii?Q?rjK5GuyB49adh9KR9thOcMdcj7FOoBl0SGg=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 93600 Subject: [ruby-core:93600] [Ruby master Bug#10891] /[[:punct:]]/ POSIX group broken (with string literals?) X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #10891 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Feedback to Closed This was apparently fixed between Ruby 2.3 and 2.4: ``` $ ruby23 -e 'p("<".force_encoding("UTF-8") =~ /[[:punct:]]/)' nil $ ruby24 -e 'p("<".force_encoding("UTF-8") =~ /[[:punct:]]/)' 0 ``` ---------------------------------------- Bug #10891: /[[:punct:]]/ POSIX group broken (with string literals?) https://bugs.ruby-lang.org/issues/10891#change-79193 * Author: tom-lord (Tom Lord) * Status: Closed * Priority: Normal * Assignee: naruse (Yui NARUSE) * Target version: * ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- The regular expression: `/[[:punct:]]/` should match the following characters: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ However, it only works for these characters: ! " # % & ' ( ) * , - . / : ; ? @ [ \\ ] _ { } And does not work for these characters: $ + < = > ^ ` | ~ However, this is where it gets really weird... Consider the following: 60.chr == "<" # true 60.chr =~ /[[:punct:]]/ # => 0 "<" =~ /[[:punct:]]/ # => nil So, it seems that the regular expression only fails for string literals! -- https://bugs.ruby-lang.org/