File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3177,7 +3177,7 @@ condition](#safe-assignment-in-condition).
31773177
31783178* <a name="no-perl-regexp-last-matchers"></a>
31793179 Don't use the cryptic Perl-legacy variables denoting last regexp group
3180- matches (`$1`, `$2`, etc). Use `Regexp.last_match[n] ` instead.
3180+ matches (`$1`, `$2`, etc). Use `Regexp.last_match(n) ` instead.
31813181<sup>[[link](#no-perl-regexp-last-matchers)]</sup>
31823182
31833183 ```Ruby
@@ -3188,7 +3188,7 @@ condition](#safe-assignment-in-condition).
31883188 process $1
31893189
31903190 # good
3191- process Regexp.last_match[1]
3191+ process Regexp.last_match(1)
31923192 ```
31933193
31943194* <a name="no-numbered-regexes"></a>
@@ -3200,7 +3200,7 @@ condition](#safe-assignment-in-condition).
32003200 # bad
32013201 /(regexp)/ =~ string
32023202 ...
3203- process Regexp.last_match[1]
3203+ process Regexp.last_match(1)
32043204
32053205 # good
32063206 /(?<meaningful_var>regexp)/ =~ string
You can’t perform that action at this time.
0 commit comments