# Regexp.new overload

**URL:** <https://www.ruby-forum.com/t/regexp-new-overload/137800>\
**Category:** IronRuby\
**Created:** [May 16, 2008, 2:29pm UTC](https://www.ruby-forum.com/t/regexp-new-overload/137800 "2008-05-16T14:29:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b5ac83/32.png) [@Wayne\_K](https://www.ruby-forum.com/u/Wayne_K)\
**Post date:** [May 16, 2008, 2:29pm UTC](https://www.ruby-forum.com/t/regexp-new-overload/137800/1 "2008-05-16T14:29:29Z")

</div>

> From: Wayne K. [removed\_email\_address@domain.invalid]  
> Sent: Friday, 16 May 2008 3:33 PM  
> To: removed\_email\_address@domain.invalid  
> 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.
