[IronPython] differences in IronPython/CPython regular expressions?

Jeff Hardy jdhardy at gmail.com
Thu Jun 2 07:54:38 CEST 2011


> Sure.  Names sensitive to capitalization; the rule I'm implementing says
> names are either capitalized or upper-case.

Ah, I see that now. I assumed the name lists were in lower case.

>
>> For the most part, CPython and IronPython regexes should be fairly
>> compatible - IronPython takes the regex and massages it to work with
>> System.Text.RE, but the changes are pretty straightforward and small,
>
> Are those changes documented anywhere?

The code is in Languages\IronPython\IronPython.Modules\re.cs in the
PreParseRegex function; it's pretty straightforward, if a little long.
Looking at it again, it's quite possible there's a bug in there, but
we'd need a minimal repro to have any hope of finding it.

> No need, until I hit .NET.  I'm used to working with a full-featured
> finite-state machine (PARC's xfst; see
> http://www.cis.upenn.edu/~cis639/docs/xfst.html), and was wondering if
> we could do similar things with Python's RE machinery.  Long lists like
> these names are often used for lists of companies or cities or such.
> People's names are actually a fairly simple and short example of this :-).

The fact that it works on CPython fairly fast indicates a bug
somewhere, I'm just not sure if it's IronPython or Mono.

- Jeff



More information about the Ironpython-users mailing list