diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | doc/re.rdoc | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Thu Dec 8 06:53:10 2011 Eric Hodel <drbrain@segment7.net> + + * doc/re.rdoc: Fix example code to match documentation. Patch by + Jarno Lamberg. [Ruby 1.9 - Bug #5624] + Wed Dec 7 19:04:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> * configure.in (rpath): fix typo in the help string. a patch from 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 |