[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...

Issue #11420 has been reported by Koichi Sasada.

11 messages 2015/08/06

[ruby-core:70634] [Ruby trunk - Misc #11495] [Documentation] Please improve documentation for Regexp.new() and clarify the 3 argument call

From: shevegen@...
Date: 2015-08-29 23:05:57 UTC
List: ruby-core #70634
Issue #11495 has been updated by Robert A. Heiler.


The current examples are:

    r1 = Regexp.new('^a-z+:\s+\w+') #=> /^a-z+:\s+\w+/
    r2 = Regexp.new('cat', true)     #=> /cat/i
    r3 = Regexp.new(r2)              #=> /cat/i
    r4 = Regexp.new('dog', Regexp::EXTENDED | Regexp::IGNORECASE) #=> /dog/ix

As you can see, we have examples for one argument, and two arguments given
but not for three arguments.

Thanks!

----------------------------------------
Misc #11495: [Documentation] Please improve documentation for Regexp.new() and clarify the 3 argument call
https://bugs.ruby-lang.org/issues/11495#change-54038

* Author: Robert A. Heiler
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Hello,

The documentation at Regepx.new here:

    http://ruby-doc.org/core-2.2.3/Regexp.html#method-c-new

It shows a lot of information, in particular four ways to call it:

    new(string, [options [, kcode]]) -> regexp
    new(regexp) -> regexp
    compile(string, [options [, kcode]]) -> regexp
    compile(regexp) -> regexp
    
However, the examples given do not show an example of where
3 arguments are passed.

Today this came up on IRC where someone asked how to use
respectively what the meaning of kcode is, via example.

Can someone add an example of where/when to use 3 arguments
to this method please? Thank you.



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next