Yep, and this will be in beta 6. It was also reported to the www.gotdotnet.com bug database a while ago.
Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo Sent: Wednesday, April 19, 2006 6:49 AM To: Discussion of IronPython Subject: Re: [IronPython] Regexp issue, or not :) 2006/4/19, Albert Einstein <[EMAIL PROTECTED]>: > m = re.compile("[a-z]+") > p = m.match("sometext") > p.group() > > Traceback (most recent call last): > File , line 0, in input##44 > File , line 0, in group##15 > IndexError: Index was outside the bounds of the array. > > Is it bug in IronPython? Yes it is. The documentation says: http://docs.python.org/lib/match-objects.html group([group1, ...]) Without arguments, group1 defaults to zero (the whole match is returned). Here's a simple fix: --- IronPython/Modules/re.cs.orig 2006-04-19 22:28:31.000000000 +0900 +++ IronPython/Modules/re.cs 2006-04-19 22:28:42.000000000 +0900 @@ -518,6 +518,11 @@ } [PythonName("group")] + public object group() { + return m.Groups[0].Value; + } + + [PythonName("group")] public object group(object index) { return m.Groups[GetGroupIndex(index)].Value; } Seo Sanghyeon _______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com