summaryrefslogtreecommitdiff
path: root/doc/regexp.rdoc
diff options
context:
space:
mode:
authorsonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 23:36:53 +0000
committersonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 23:36:53 +0000
commitba9e870709d59cfea8c84bb2ef8f217bd3923e79 (patch)
tree5af7ad949a13d62a9a08ca7527f3ccdcfc18bd71 /doc/regexp.rdoc
parentd9e11970f8bcc7de126be41efd934ccd94cdde8b (diff)
* doc/regexp.rdoc: Fix regexp doc syntax highlighting
patched by jlmuir (J. Lewis Muir) [fix GH-1678] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc/regexp.rdoc')
-rw-r--r--doc/regexp.rdoc8
1 files changed, 4 insertions, 4 deletions
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.
/\$(?<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 fixed by supplying
<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