зеркало из https://github.com/github/ruby.git
Document that Regexp#source does not retain lexer escapes
Related to [Feature #18838]
This commit is contained in:
Родитель
850b54612c
Коммит
596f4b0d3a
6
re.c
6
re.c
|
@ -487,10 +487,14 @@ rb_reg_desc(const char *s, long len, VALUE re)
|
||||||
*
|
*
|
||||||
* /ab+c/ix.source # => "ab+c"
|
* /ab+c/ix.source # => "ab+c"
|
||||||
*
|
*
|
||||||
* Note that escape sequences are retained as is:
|
* Regexp escape sequences are retained:
|
||||||
*
|
*
|
||||||
* /\x20\+/.source # => "\\x20\\+"
|
* /\x20\+/.source # => "\\x20\\+"
|
||||||
*
|
*
|
||||||
|
* Lexer escape characters are not retained:
|
||||||
|
*
|
||||||
|
* /\//.source # => "/"
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
Загрузка…
Ссылка в новой задаче