From: "nathanst (Nathan Stratton Treadway)" Date: 2012-06-13T05:14:59+09:00 Subject: [ruby-core:45602] [ruby-trunk - Bug #6488] String#slice example has a syntax error Issue #6488 has been updated by nathanst (Nathan Stratton Treadway). =begin zzak (Zachary Scott) wrote: > I was unable to reproduce this with ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux] and rdoc 3.9.4 > > Could be an issue with ruby-doc.org? More specifically, it was a problem in the HTML pages generated by RDoc v3.12 (and ruby-doc.org was indeed using that version). Over the weekend James Britt regenerated the "core" and "std=lib" RDoc pages (for all Ruby versions) using a copy of rdoc that included this bug's ruby_lex.rb patches, so the regexp literals on those pages should be fixed now. (The gem RDocs on the site are built separately and so they may not have been updated yet.) =end ---------------------------------------- Bug #6488: String#slice example has a syntax error https://bugs.ruby-lang.org/issues/6488#change-27200 Author: amorsen (Benny Lyne Amorsen) Status: Closed Priority: Normal Assignee: drbrain (Eric Hodel) Category: DOC Target version: 1.9.3 ruby -v: ruby 1.9.3p0 (2011-10-30) [x86_64-linux] http://www.ruby-doc.org/core-1.9.3/String.html#method-i-slice has a syntax error: a[%r[aeiou](.)\11//] #=> "ell" a[%r[aeiou](.)\11//, 0] #=> "ell" a[%r[aeiou](.)\11//, 1] #=> "l" a[%r[aeiou](.)\11//, 2] #=> nil Oh, I have just realized that similar problems exist in the other regexp examples on the page, not just for slice. -- http://bugs.ruby-lang.org/