ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: nobu@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:68260] [Ruby trunk - Bug #10891] /[[:punct:]]/ POSIX group broken (with string literals?)
Date: Mon, 23 Feb 2015 14:45:53 +0000	[thread overview]
Message-ID: <redmine.journal-51615.20150223144552.842ab22ea074192f@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-10891.20150223122909@ruby-lang.org

Issue #10891 has been updated by Nobuyoshi Nakada.

Description updated

It occurs with UTF-8 encoding only.

----------------------------------------
Bug #10891: /[[:punct:]]/ POSIX group broken (with string literals?)
https://bugs.ruby-lang.org/issues/10891#change-51615

* Author: Tom Lord
* Status: Open
* Priority: Normal
* Assignee: ruby-core
* 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/

  parent reply	other threads:[~2015-02-23 14:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-10891.20150223122909@ruby-lang.org>
2015-02-23 12:29 ` [ruby-core:68254] [Ruby trunk - Bug #10891] [Open] /[[:punct:]]/ POSIX group broken (with string literals?) lord.thom
2015-02-23 14:45 ` nobu [this message]
2015-02-23 15:53 ` [ruby-core:68263] [Ruby trunk - Bug #10891] " lord.thom
2015-02-24 10:03 ` [ruby-core:68280] " lord.thom
2015-11-30  3:14 ` [ruby-core:71742] " shugo
2015-11-30  9:42 ` [ruby-core:71746] [Ruby trunk - Bug #10891] [Feedback] " naruse
2015-11-30 13:48 ` [ruby-core:71756] [Ruby trunk - Bug #10891] " shugo
2019-07-08  1:07 ` [ruby-core:93600] [Ruby master Bug#10891] " merch-redmine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-51615.20150223144552.842ab22ea074192f@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).