ruby-changes:48210
From: sonots <ko1@a...>
Date: Sun, 22 Oct 2017 08:36:58 +0900 (JST)
Subject: [ruby-changes:48210] sonots:r60325 (trunk): * doc/regexp.rdoc: Fix regexp doc syntax highlighting
sonots 2017-10-22 08:36:53 +0900 (Sun, 22 Oct 2017) New Revision: 60325 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60325 Log: * doc/regexp.rdoc: Fix regexp doc syntax highlighting patched by jlmuir (J. Lewis Muir) [fix GH-1678] Modified files: trunk/doc/regexp.rdoc Index: doc/regexp.rdoc =================================================================== --- doc/regexp.rdoc (revision 60324) +++ doc/regexp.rdoc (revision 60325) @@ -227,7 +227,7 @@ Capture groups can be referred to by nam https://github.com/ruby/ruby/blob/trunk/doc/regexp.rdoc#L227 constructs. /\$(?<dollars>\d+)\.(?<cents>\d+)/.match("$3.67") - => #<MatchData "$3.67" dollars:"3" cents:"67"> + #=> #<MatchData "$3.67" dollars:"3" cents:"67"> /\$(?<dollars>\d+)\.(?<cents>\d+)/.match("$3.67")[:dollars] #=> "3" Named groups can be backreferenced with <tt>\k<</tt><i>name</i><tt>></tt>, @@ -607,9 +607,9 @@ regexp's encoding can be explicitly fixe https://github.com/ruby/ruby/blob/trunk/doc/regexp.rdoc#L607 <tt>Regexp.new</tt>: 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/