Skip to content

Commit b908306

Browse files
nobuhsbt
authored andcommitted
[DOC] Reword "Regular Expression" to "Matched Data"
`$~` and its accessors are related to regular expressions, but are not themselves.
1 parent 84edb84 commit b908306

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

doc/language/globals.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require 'English'
1919
| `$!` | `$ERROR_INFO` | \Exception object or `nil` | `nil` | Yes | Kernel#raise |
2020
| `$@` | `$ERROR_POSITION` | \Array of backtrace positions or `nil` | `nil` | Yes | Kernel#raise |
2121

22-
### Regular Expression
22+
### Matched Data
2323

2424
| Variable | \English | Contains | Initially | Read-Only | Reset By |
2525
|:-------------:|:-------------------:|-----------------------------------|:---------:|:---------:|-----------------|
@@ -127,7 +127,7 @@ Output:
127127

128128
English - `$ERROR_POSITION`.
129129

130-
## Regular Expression
130+
## Matched Data
131131

132132
These global variables store information about the most recent
133133
successful match in the current scope.

doc/string/partition.rdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Note that in the examples below, a returned string <tt>'hello'</tt>
1717
is a copy of +self+, not +self+.
1818

1919
If +pattern+ is a Regexp, performs the equivalent of <tt>self.match(pattern)</tt>
20-
(also setting {pattern-matching global variables}[rdoc-ref:language/globals.md@Regular+Expression]):
20+
(also setting {matched-data variables}[rdoc-ref:language/globals.md@Matched+Data]):
2121

2222
'hello'.partition(/h/) # => ["", "h", "ello"]
2323
'hello'.partition(/l/) # => ["he", "l", "lo"]
@@ -30,7 +30,7 @@ If +pattern+ is a Regexp, performs the equivalent of <tt>self.match(pattern)</tt
3030

3131
If +pattern+ is not a Regexp, converts it to a string (if it is not already one),
3232
then performs the equivalent of <tt>self.index(pattern)</tt>
33-
(and does _not_ set {pattern-matching global variables}[rdoc-ref:language/globals.md@Regular+Expression]):
33+
(and does _not_ set {matched-data global variables}[rdoc-ref:language/globals.md@Matched+Data]):
3434

3535
'hello'.partition('h') # => ["", "h", "ello"]
3636
'hello'.partition('l') # => ["he", "l", "lo"]

doc/string/rpartition.rdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The pattern used is:
2323
Note that in the examples below, a returned string <tt>'hello'</tt> is a copy of +self+, not +self+.
2424

2525
If +pattern+ is a Regexp, searches for the last matching substring
26-
(also setting {pattern-matching global variables}[rdoc-ref:language/globals.md@Regular+Expression]):
26+
(also setting {matched-data global variables}[rdoc-ref:language/globals.md@Matched+Data]):
2727

2828
'hello'.rpartition(/l/) # => ["hel", "l", "o"]
2929
'hello'.rpartition(/ll/) # => ["he", "ll", "o"]
@@ -36,7 +36,7 @@ If +pattern+ is a Regexp, searches for the last matching substring
3636

3737
If +pattern+ is not a Regexp, converts it to a string (if it is not already one),
3838
then searches for the last matching substring
39-
(and does _not_ set {pattern-matching global variables}[rdoc-ref:language/globals.md@Regular+Expression]):
39+
(and does _not_ set {matched-data global variables}[rdoc-ref:language/globals.md@Matched+Data]):
4040

4141
'hello'.rpartition('l') # => ["hel", "l", "o"]
4242
'hello'.rpartition('ll') # => ["he", "ll", "o"]

0 commit comments

Comments
 (0)