ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:47183] [ruby-trunk - Bug #8138][Open] rpartition(regexp) for multibyte string
@ 2013-03-21 14:08 no6v (Nobuhiro IMAI)
  0 siblings, 0 replies; only message in thread
From: no6v (Nobuhiro IMAI) @ 2013-03-21 14:08 UTC (permalink / raw
  To: ruby developers list


Issue #8138 has been reported by no6v (Nobuhiro IMAI).

----------------------------------------
Bug #8138: rpartition(regexp) for multibyte string
https://bugs.ruby-lang.org/issues/8138

Author: no6v (Nobuhiro IMAI)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0dev (2013-03-21 trunk 39858) [x86_64-linux]


=begin
以下のように、String#rpartition に正規表現を渡したとき、マルチバイト文字列だと挙動がおかしいようです。

 # encoding: UTF-8
 "user@domain".partition("@")     # => ["user", "@", "domain"]
 "user@domain".partition(/@/)     # => ["user", "@", "domain"]
 "user@domain".rpartition("@")    # => ["user", "@", "domain"]
 "user@domain".rpartition(/@/)    # => ["user", "@", "domain"]
 "ユーザ@ドメイン".partition("@")  # => ["ユーザ", "@", "ドメイン"]
 "ユーザ@ドメイン".partition(/@/)  # => ["ユーザ", "@", "ドメイン"]
 "ユーザ@ドメイン".rpartition("@") # => ["ユーザ", "@", "ドメイン"]
 "ユーザ@ドメイン".rpartition(/@/) # => ["ユーザ@ドメイン", "@", nil]
=end



-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-21 14:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 14:08 [ruby-dev:47183] [ruby-trunk - Bug #8138][Open] rpartition(regexp) for multibyte string no6v (Nobuhiro IMAI)

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).