diff --git a/doc/regexp.rdoc b/doc/regexp.rdoc index 49fce51a8d..a6421a5e80 100644 --- a/doc/regexp.rdoc +++ b/doc/regexp.rdoc @@ -227,7 +227,7 @@ Capture groups can be referred to by name when defined with the constructs. /\$(?\d+)\.(?\d+)/.match("$3.67") - => # + #=> # /\$(?\d+)\.(?\d+)/.match("$3.67")[:dollars] #=> "3" Named groups can be backreferenced with \k<name>, @@ -607,9 +607,9 @@ regexp's encoding can be explicitly fixed by supplying Regexp.new: r = Regexp.new("a".force_encoding("iso-8859-1"),Regexp::FIXEDENCODING) - r =~"a\u3042" - #=> Encoding::CompatibilityError: incompatible encoding regexp match - (ISO-8859-1 regexp with UTF-8 string) + r =~ "a\u3042" + # raises Encoding::CompatibilityError: incompatible encoding regexp match + # (ISO-8859-1 regexp with UTF-8 string) == Special global variables