[IronPython] Bug in re module

Mike Hostetler hostetlerm at gmail.com
Fri Jul 22 07:33:36 CEST 2005


When trying to local a "simple" regular expression, I get the following:

$ IronPython-0.7.6/bin/IronPythonConsole.exe
IronPython 0.7.6 on .NET 2.0.50215.44
Copyright (c) Microsoft Corporation. All rights reserved.
>>> import re
>>> sect = re.compile('\[(?P<header>[^]]+)\]')
System.ArgumentException: parsing "\[(?P<header>[^]]+)\]" - Unrecognized groupin
g construct.
   at System.Text.RegularExpressions.RegexParser.ScanGroupOpen()
   at System.Text.RegularExpressions.RegexParser.ScanRegex()
   at System.Text.RegularExpressions.RegexParser.Parse(String re, RegexOptions o
p)
   at System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions op
tions, Boolean useCache)
   at System.Text.RegularExpressions.Regex..ctor(String pattern)
   at input_1.Run(Frame frame)

It seems to not like the group name.
-- 
Mike Hostetler
http://www.binary.net/thehaas



More information about the Ironpython-users mailing list