[Ironruby-core] Regexp.new overload

Wayne Kelly w.kelly at qut.edu.au
Fri May 16 08:28:09 EDT 2008


> From: Wayne Kelly [w.kelly at qut.edu.au]
> Sent: Friday, 16 May 2008 3:33 PM
> To: ironruby-core at rubyforge.org
> Subject: Re: [Ironruby-core] IronRuby r109 is out
>
> ...
>
> The rest fail for the following reasons:
> 13 - Regexp.new overloads not implemented
> ...

The missing overload for Regexp.new is the one that takes two string parameters, the second parameter represents the options and need not be an integer, if the options is not false then the regexp will be case insensitive.

The required patch is something like:

[RubyConstructor]
public static RubyRegex/*!*/ Create([NotNull]MutableString/*!*/ str, object options) {
    return new RubyRegex(str, RubyRegex.ToClrOptions(Protocols.IsTrue(options) ? RegExOptions.IGNORECASE : RegExOptions.NONE));
}

Cheers, Wayne.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080516/40a9e4df/attachment.html>


More information about the Ironruby-core mailing list