Skip to content

Commit d615dbf

Browse files
[DOC] Japanese for multi-byte characters
1 parent 44e762a commit d615dbf

File tree

6 files changed

+30
-31
lines changed

6 files changed

+30
-31
lines changed

doc/language/character_selectors.rdoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

3736
Note that order and repetitions do not matter:

doc/matchdata/begin.rdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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

2020
When string or symbol argument +name+ is given,
2121
returns the offset of the beginning for the named match:

doc/matchdata/bytebegin.rdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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

2020
When string or symbol argument +name+ is given,
2121
returns the offset of the beginning for the named match:

doc/matchdata/byteend.rdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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

2020
When string or symbol argument +name+ is given,
2121
returns the offset of the end for the named match:

doc/matchdata/end.rdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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

2020
When string or symbol argument +name+ is given,
2121
returns the offset of the end for the named match:

doc/matchdata/offset.rdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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

2121
When string or symbol argument +name+ is given,
2222
returns the starting and ending offsets for the named match:

0 commit comments

Comments
 (0)