On Mon, Mar 22, 2010 at 3:52 PM, Tom Philpot <tom.phil...@logos.com> wrote:
> So we've reported this bug here: > https://bugzilla.novell.com/show_bug.cgi?id=474154 > > 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.", > 4, > 5).Success > > evaluates to true in Microsoft's implementation, but false in Mono. It > appears > that in Microsoft's implementation, the results of the method are > comparable to > calling string.Substring() on the string being passed in, except that > indexes > 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.", > 4).Success > > evaluates to false both in Microsoft's implementation and in Mono. Any fix > to > 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 it's behavior. 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.
_______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list