種類
- インスタンスメソッド (72)
- 文書 (22)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (11) -
each
_ codepoint (36) - 正規表現 (11)
検索結果
先頭5件
-
String
# codepoints -> [Integer] (39120.0) -
文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)
...".codepoints
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
//}
ブロックが指定された場合は String#each_codepoint と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#eac... -
String
# codepoints {|codepoint| block } -> self (39120.0) -
文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)
...".codepoints
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
//}
ブロックが指定された場合は String#each_codepoint と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#eac... -
StringIO
# codepoints -> Enumerator (21102.0) -
自身の各コードポイントに対して繰り返します。
自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint -
StringIO
# codepoints {|codepoint| . . . } -> self (21102.0) -
自身の各コードポイントに対して繰り返します。
自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint -
String
# each _ codepoint -> Enumerator (21012.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 (21012.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... -
StringIO
# each _ codepoint -> Enumerator (6002.0) -
自身の各コードポイントに対して繰り返します。
自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint -
StringIO
# each _ codepoint {|codepoint| . . . } -> self (6002.0) -
自身の各コードポイントに対して繰り返します。
自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint -
NEWS for Ruby 2
. 0 . 0 (114.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...る使用されていない変数は警告しなくなりました
=== 組み込みクラスの更新
* ARGF.class
* 追加: ARGF.class#codepoints, ARGF.class#each_codepoint
IO にある同名のメソッドに対応します
* Array
* 追加: Array#bsearch 二分探索します......ault_proc= default proc をクリアするために nil を渡せるようになりました
* IO
* 非推奨: IO#lines, #bytes, #chars, #codepoints
* Kernel
* 追加: Kernel.#Hash という変換メソッド。Kernel.#Array, Kernel.#Float に似ています
* 追加: Kernel.#__dir......* String
* 追加: String#b エンコーディングを ASCII-8BIT に設定したコピーされた文字列を返します
* 返り値変更:
* String#lines Enumerator ではなく Array を返します
* String#chars Enumerator ではなく Array を返します
* String... -
正規表現 (52.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
...正規表現
* metachar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references
正規表現(regular ex......以外の
その文字列そのものにマッチするような文字列があります。
前者をメタ文字列(meta string)、後者をリテラル(文字列)(literal string)と呼びます。
//emlist[][ruby]{
/京都|大阪|神戸/
//}
という正規表現においては、「京都」「......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]{
/...