зеркало из https://github.com/github/ruby.git
Document encoding of string returned by Regexp.quote [ci skip]
Also, remove documentation about returning self, which makes no sense as self would be the Regexp class. It could be interpreted as return the argument if no changes were made, but that hasn't been the behavior at least since 1.8.7 (and probably before). Fixes [Bug #10239]
This commit is contained in:
Родитель
c1ad6321b0
Коммит
32ec6dd5c7
4
re.c
4
re.c
|
@ -3578,8 +3578,8 @@ rb_reg_quote(VALUE str)
|
||||||
* Regexp.quote(str) -> string
|
* Regexp.quote(str) -> string
|
||||||
*
|
*
|
||||||
* Escapes any characters that would have special meaning in a regular
|
* Escapes any characters that would have special meaning in a regular
|
||||||
* expression. Returns a new escaped string, or self if no characters are
|
* expression. Returns a new escaped string with the same or compatible
|
||||||
* escaped. For any string,
|
* encoding. For any string,
|
||||||
* <code>Regexp.new(Regexp.escape(<i>str</i>))=~<i>str</i></code> will be true.
|
* <code>Regexp.new(Regexp.escape(<i>str</i>))=~<i>str</i></code> will be true.
|
||||||
*
|
*
|
||||||
* Regexp.escape('\*?{}.') #=> \\\*\?\{\}\.
|
* Regexp.escape('\*?{}.') #=> \\\*\?\{\}\.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче