Project

General

Profile

Bug #5624

Mismatch between code example and its description in text in Regexp documentation

Added by jlamberg (Jarno Lamberg) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
Backport:
[ruby-core:40975]

Description

I found that in Regexp.html (doc/re.rdoc) under the heading Performance there is the description:

"Consider a string of 25 as, a d, 4 as, and a c."

with a code example:

s = 'a' * 25 + 'd' 'a' * 4 + 'c'
#=> "aaaaaaaaaaaaaaaaaaaaaaaaadadadadac"

The code example doesn't match its description.

I fixed that with the attached patch.


Files


Related issues

Has duplicate Ruby master - Bug #6526: minor typo in Regexp class documentationCloseddrbrain (Eric Hodel)06/01/2012Actions

Updated by jlamberg (Jarno Lamberg) over 8 years ago

I committed the change to GitHub and made a pull request, too, as I was not sure which way would work better.

The link to the pull request is:

https://github.com/ruby/ruby/pull/57

#2

Updated by drbrain (Eric Hodel) over 8 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r33976.
Jarno, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • doc/re.rdoc: Fix example code to match documentation. Patch by Jarno Lamberg. [Ruby 1.9 - Bug #5624]

Also available in: Atom PDF