diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-07-22 14:43:36 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-07-22 14:43:36 -0700 |
commit | 32ec6dd5c7cb89979d48100acf8971ac09e0d02e (patch) | |
tree | 8c00146bc9a820278ec49d1a786d106b93db7906 | |
parent | c1ad6321b03bcf9f96f975bcba7ff1d205990149 (diff) | |
download | ruby-32ec6dd5c7cb89979d48100acf8971ac09e0d02e.tar.gz |
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]
-rw-r--r-- | re.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3578,8 +3578,8 @@ rb_reg_quote(VALUE str) * Regexp.quote(str) -> string * * Escapes any characters that would have special meaning in a regular - * expression. Returns a new escaped string, or self if no characters are - * escaped. For any string, + * expression. Returns a new escaped string with the same or compatible + * encoding. For any string, * <code>Regexp.new(Regexp.escape(<i>str</i>))=~<i>str</i></code> will be true. * * Regexp.escape('\*?{}.') #=> \\\*\?\{\}\. |