別のキーワード
種類
- インスタンスメソッド (104)
- 文書 (24)
クラス
-
ARGF
. class (14) - IO (14)
- String (48)
- StringIO (28)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (12) -
each
_ codepoint (38) - 正規表現 (12)
検索結果
-
正規表現 (12.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
...p{M}*)
//emlist[][ruby]{
# \u{0308} はウムラウト
/\X/.match("e\u{0308}") # => #<MatchData "ë">
$&.codepoints # => [101, 776]
/\w/.match("e\u{0308}") # => #<MatchData "e">
$&.codepoints # => [101]
//}
ただし、\R は文字クラスの中では使用できません。
//emlist[][ruby]{
/... -
String
# each _ codepoint -> Enumerator (6.0) -
文字列の各コードポイントに対して繰り返します。
...ます。
//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}
@see String#codepoints... -
String
# each _ codepoint {|codepoint| block } -> self (6.0) -
文字列の各コードポイントに対して繰り返します。
...ます。
//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}
@see String#codepoints...