Document that Regexp#source does not retain lexer escapes

Related to [Feature #18838]
This commit is contained in:
Jeremy Evans 2022-06-20 15:17:23 -07:00
Родитель 850b54612c
Коммит 596f4b0d3a
1 изменённых файлов: 5 добавлений и 1 удалений

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