mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
89beb18b56
commit
52654367f6
2 changed files with 8 additions and 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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue