summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-07 23:02:58 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-07 23:02:58 +0000
commit52654367f6a4caa131e809b2067a5e2b45f0893a (patch)
tree22a86d7da8b0edbf0da051313fe43afe42522a8e /doc
parent89beb18b56ffa12df9d4eb440f3632c943fdb1bf (diff)
* doc/re.rdoc: Fix example code to match documentation. Patch by
Jarno Lamberg. [Ruby 1.9 - Bug #5624] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc')
-rw-r--r--doc/re.rdoc6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/re.rdoc b/doc/re.rdoc
index 0dfd8e5164..23eb37dfe2 100644
--- a/doc/re.rdoc
+++ b/doc/re.rdoc
@@ -533,8 +533,8 @@ performance.
Consider a string of 25 <i>a</i>s, a <i>d</i>, 4 <i>a</i>s, and a
<i>c</i>.
- s = 'a' * 25 + 'd' 'a' * 4 + 'c'
- #=> "aaaaaaaaaaaaaaaaaaaaaaaaadadadadac"
+ s = 'a' * 25 + 'd' + 'a' * 4 + 'c'
+ #=> "aaaaaaaaaaaaaaaaaaaaaaaaadaaaac"
The following patterns match instantly as you would expect:
@@ -544,7 +544,7 @@ The following patterns match instantly as you would expect:
However, the following pattern takes appreciably longer:
- /(b|a+)*c/ =~ s #=> 32
+ /(b|a+)*c/ =~ s #=> 26
This happens because an atom in the regexp is quantified by both an
immediate <tt>+</tt> and an enclosing <tt>*</tt> with nothing to