[Mono-dev] Regex.Match(string, int, int) behaves differently than Microsoft's implementation
kumpera at gmail.com
Mon Mar 22 15:21:24 EDT 2010
On Mon, Mar 22, 2010 at 3:52 PM, Tom Philpot <tom.philpot at logos.com> wrote:
> So we've reported this bug here:
> Text of the bug report is as follows:
> Certain regular expressions will behave differently on Mono when calling
> Regex.Match(string, int, int). In particular the expression
> new Regex("^quick$").Match("The quick brown fox jumps over the lazy dog.",
> evaluates to true in Microsoft's implementation, but false in Mono. It
> that in Microsoft's implementation, the results of the method are
> comparable to
> calling string.Substring() on the string being passed in, except that
> are still reported in terms of the original string.
> As a side note, the expression
> new Regex("^quick").Match("The quick brown fox jumps over the lazy dog.",
> evaluates to false both in Microsoft's implementation and in Mono. Any fix
> the former should not break the latter.
> Before I went digging into the bug, I thought I'd ask if any of the devs
> had a quick fix.
Fixing bugs in the regexp engine is really really hard given how subtle is
Providing a good suite of tests is a great way forwards having it fixed.
I don`t think short-circuiting and checking for "^???$" is the right fix
since the check is
pretty complex due to other regexp rules that can be inside.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list