File tree Expand file tree Collapse file tree 6 files changed +30
-31
lines changed
Expand file tree Collapse file tree 6 files changed +30
-31
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ contained in the selector itself:
3131 'abracadabra'.delete('abc') # => "rdr"
3232 '0123456789'.delete('258') # => "0134679"
3333 '!@#$%&*()_+'.delete('+&#') # => "!@$%*()_"
34- 'тест'.delete('т') # => "ес"
3534 'こんにちは'.delete('に') # => "こんちは"
3635
3736Note that order and repetitions do not matter:
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ returns the offset of the beginning of the <tt>n</tt>th match:
1010 m[3] # => "113"
1111 m.begin(3) # => 3
1212
13- m = /(т)(е)(с )/.match('тест ')
14- # => #<MatchData "тес " 1:"т " 2:"е " 3:"с ">
15- m[0] # => "тес "
16- m.begin(0) # => 0
17- m[3] # => "с "
18- m.begin(3) # => 2
13+ m = /(ん)(に)(ち )/.match('こんにちは ')
14+ # => #<MatchData "んにち " 1:"ん " 2:"に " 3:"ち ">
15+ m[0] # => "んにち "
16+ m.begin(0) # => 1
17+ m[3] # => "ち "
18+ m.begin(3) # => 3
1919
2020When string or symbol argument +name+ is given,
2121returns the offset of the beginning for the named match:
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ returns the offset of the beginning of the <tt>n</tt>th match:
1010 m[3] # => "113"
1111 m.bytebegin(3) # => 3
1212
13- m = /(т)(е)(с )/.match('тест ')
14- # => #<MatchData "тес " 1:"т " 2:"е " 3:"с ">
15- m[0] # => "тес "
16- m.bytebegin(0) # => 0
17- m[3] # => "с "
18- m.bytebegin(3) # => 4
13+ m = /(ん)(に)(ち )/.match('こんにちは ')
14+ # => #<MatchData "んにち " 1:"ん " 2:"に " 3:"ち ">
15+ m[0] # => "んにち "
16+ m.bytebegin(0) # => 3
17+ m[3] # => "ち "
18+ m.bytebegin(3) # => 9
1919
2020When string or symbol argument +name+ is given,
2121returns the offset of the beginning for the named match:
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ returns the offset of the end of the <tt>n</tt>th match:
1010 m[3] # => "113"
1111 m.byteend(3) # => 6
1212
13- m = /(т)(е)(с )/.match('тест ')
14- # => #<MatchData "тес " 1:"т " 2:"е " 3:"с ">
15- m[0] # => "тес "
16- m.byteend(0) # => 6
17- m[3] # => "с "
18- m.byteend(3) # => 6
13+ m = /(ん)(に)(ち )/.match('こんにちは ')
14+ # => #<MatchData "んにち " 1:"ん " 2:"に " 3:"ち ">
15+ m[0] # => "んにち "
16+ m.byteend(0) # => 12
17+ m[3] # => "ち "
18+ m.byteend(3) # => 12
1919
2020When string or symbol argument +name+ is given,
2121returns the offset of the end for the named match:
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ returns the offset of the end of the <tt>n</tt>th match:
1010 m[3] # => "113"
1111 m.end(3) # => 6
1212
13- m = /(т)(е)(с )/.match('тест ')
14- # => #<MatchData "тес " 1:"т " 2:"е " 3:"с ">
15- m[0] # => "тес "
16- m.end(0) # => 3
17- m[3] # => "с "
18- m.end(3) # => 3
13+ m = /(ん)(に)(ち )/.match('こんにちは ')
14+ # => #<MatchData "んにち " 1:"ん " 2:"に " 3:"ち ">
15+ m[0] # => "んにち "
16+ m.end(0) # => 4
17+ m[3] # => "ち "
18+ m.end(3) # => 4
1919
2020When string or symbol argument +name+ is given,
2121returns the offset of the end for the named match:
Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ returns the starting and ending offsets of the <tt>n</tt>th match:
1111 m[3] # => "113"
1212 m.offset(3) # => [3, 6]
1313
14- m = /(т)(е)(с )/.match('тест ')
15- # => #<MatchData "тес " 1:"т " 2:"е " 3:"с ">
16- m[0] # => "тес "
17- m.offset(0) # => [0, 3 ]
18- m[3] # => "с "
19- m.offset(3) # => [2, 3 ]
14+ m = /(ん)(に)(ち )/.match('こんにちは ')
15+ # => #<MatchData "んにち " 1:"ん " 2:"に " 3:"ち ">
16+ m[0] # => "んにち "
17+ m.offset(0) # => [1, 4 ]
18+ m[3] # => "ち "
19+ m.offset(3) # => [3, 4 ]
2020
2121When string or symbol argument +name+ is given,
2222returns the starting and ending offsets for the named match:
You can’t perform that action at this time.
0 commit comments