From 71b932d675b53cbad6048e2c44a86b39b4310ad3 Mon Sep 17 00:00:00 2001 From: sonots Date: Sat, 21 Oct 2017 23:38:17 +0000 Subject: [PATCH] * doc/regexp.rdoc: In regexp doc, two backslashes match one literally In the "Metacharacters and Escapes" section of regexp.rdoc, it said that to match a backslash literally, it must be backslash-escaped, but the rendered HTML showed three backslashes (\\\). There should only be two backslashes (\\). patched by jlmuir (J. Lewis Muir) [fix GH-1677] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- doc/regexp.rdoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/regexp.rdoc b/doc/regexp.rdoc index a6421a5e80..06c730058d 100644 --- a/doc/regexp.rdoc +++ b/doc/regexp.rdoc @@ -63,9 +63,10 @@ The following are metacharacters (, ), [, ], {, }, ., ?, +, *. They have a specific meaning when appearing in a pattern. To match them literally they must be backslash-escaped. To match -a backslash literally backslash-escape that: \\\\\\. +a backslash literally, backslash-escape it: \\\\. /1 \+ 2 = 3\?/.match('Does 1 + 2 = 3?') #=> # + /a\\\\b/.match('a\\\\b') #=> # Patterns behave like double-quoted strings so can contain the same backslash escapes.