File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -4965,13 +4965,16 @@ str_ensure_byte_pos(VALUE str, long pos)
49654965 * s.byteindex('ooo') # => nil
49664966 *
49674967 * When +object+ is a Regexp,
4968- * returns the index of the first found substring matching +object+:
4968+ * returns the index of the first found substring matching +object+;
4969+ * updates {Regexp-related global variables}[rdoc-ref:Regexp@Global+Variables]:
49694970 *
49704971 * s = 'foo'
49714972 * s.byteindex(/f/) # => 0
4973+ * $~ # => #<MatchData "f">
49724974 * s.byteindex(/o/) # => 1
49734975 * s.byteindex(/oo/) # => 1
49744976 * s.byteindex(/ooo/) # => nil
4977+ * $~ # => nil
49754978 *
49764979 * \Integer argument +offset+, if given, specifies the 0-based index
49774980 * of the byte where searching is to begin.
@@ -4992,7 +4995,7 @@ str_ensure_byte_pos(VALUE str, long pos)
49924995 * s.byteindex('o', -3) # => 1
49934996 * s.byteindex('o', -4) # => nil
49944997 *
4995- * Raises IndexError if +offset+ does not land of a character boundary :
4998+ * Raises IndexError if the byte at +offset+ is not the first byte of a character:
49964999 *
49975000 * s = "\uFFFF\uFFFF" # => "\uFFFF\uFFFF"
49985001 * s.size # => 2 # Two 3-byte characters.
You can’t perform that action at this time.
0 commit comments