summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2022-06-20 15:17:23 -0700
committerJeremy Evans <code@jeremyevans.net>2022-06-20 15:56:28 -0700
commit596f4b0d3ab8bc2559a52396d3a29ce62e6a3694 (patch)
treeafa9d3483b3f11e3504beed03221db48962dfa19 /re.c
parent850b54612c21ee46ba8c03bf028e8426b9b4786c (diff)
downloadruby-596f4b0d3ab8bc2559a52396d3a29ce62e6a3694.tar.gz
Document that Regexp#source does not retain lexer escapes
Related to [Feature #18838]
Diffstat (limited to 're.c')
-rw-r--r--re.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/re.c b/re.c
index 3e059b6287..002be7ce9e 100644
--- a/re.c
+++ b/re.c
@@ -487,10 +487,14 @@ rb_reg_desc(const char *s, long len, VALUE re)
*
* /ab+c/ix.source # => "ab+c"
*
- * Note that escape sequences are retained as is:
+ * Regexp escape sequences are retained:
*
* /\x20\+/.source # => "\\x20\\+"
*
+ * Lexer escape characters are not retained:
+ *
+ * /\//.source # => "/"
+ *
*/
static VALUE