From: cohei <noreply@ruby-lang.org>
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:51184] [Ruby master Bug#18802] Negation of POSIX character class does not work
Date: Wed, 25 May 2022 03:34:29 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-97732.20220525033428.52339@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-18802.20220525024111.52339@ruby-lang.org>
Issue #18802 has been updated by cohei (昂平 谷口).
Thank you! I misunderstood about character classes.
----------------------------------------
Bug #18802: Negation of POSIX character class does not work
https://bugs.ruby-lang.org/issues/18802#change-97732
* Author: cohei (昂平 谷口)
* Status: Rejected
* Priority: Normal
* ruby -v: 3.1.2
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
> https://docs.ruby-lang.org/ja/3.1/doc/spec=2fregexp.html#charclass_posix
> また、[:^クラス名:]という記法でその否定を意味します。
For example, `[:^ascii:]` is the negation of `[:ascii:]` according to the document. But it does not work:
```ruby
irb(main):001:0> RUBY_VERSION
=> "3.1.2"
irb(main):002:0> %w[あああ あ a b :].map { _1.match?(/[:^ascii:]/) }
=> [false, false, true, false, true] # matches a, c, i, s, : or ^
irb(main):003:0> %w[あああ あ a b :].map { _1.match?(/[^[:ascii:]]/) }
=> [true, true, false, false, false] # expected
```
--
https://bugs.ruby-lang.org/
prev parent reply other threads:[~2022-05-25 3:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 2:41 [ruby-dev:51182] " cohei
2022-05-25 3:02 ` [ruby-dev:51183] " mame (Yusuke Endoh)
2022-05-25 3:34 ` cohei [this message]
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-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-97732.20220525033428.52339@ruby-lang.org \
--to=noreply@ruby-lang.org \
--cc=ruby-dev@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 NNTP newsgroup(s).