Python RegEx through the ages, Appendix C: Summary table

← Return to main document

Colliding names used by multiple non-interchangable modules (regex and pcre) are preceded by a disambiguating numerical superscript.

Included with    Base APIEngineMain module nameC module nameOther modulesNotes
0.9.0–0.9.1First (exec)Henry SpencerregexpregexpPosix Extended format. First public release of Python. Very simple API.
0.9.2–0.9.4First (match)Henry Spencerregexpregexpexec method renamed to match.
0.9.5            SecondGNU(1st)regex(1st)regexregex_syntaxEmacs-style format by default, but changeable with flags.
0.9.6–2.4  SecondYlönen based(1st)regex(1st)regexregex_syntax, later also regsubChanged to engine written by Tatu Ylönen. Emitting DeprecationWarning since 2.1, finally removed in 2.5.0alpha1.
0.9.5–1.4  First (match)(same as (1st)regex)regexp(1st)regex Wrapper around the contemporary (1st)regex module. Module removed in 1.5.0beta1.
1.5.0            ThirdYlönen based (bytecode), custom (parsing)re or re1reop Perl-style format. New thread-safe API defined. Introduced as re in 1.5.0alpha3, implementation never fully debugged before it was superseded in 1.5.0alpha4. Retained as re1 for the 1.5.0 release, removed before 1.5.1.
1.5–2.3    ThirdPCRE (old)re or pre(1st)pcreIntroduced in 1.5.0alpha4 using what was then (late 1990s) a contemporary PCRE library. In particular, Unicode regular expressions were not yet supported. Renamed to pre in Python 2. Removed in Python 2.4.
1.6–presentThirdSecretLabs basedsre or re_sresre_compile, sre_parse, sre_constantsIntroduced with Python 2 as sre due to the need for a re implementation that supported Unicode regular expressions. Initially used a recursive matching scheme, this was changed in Python 2.4.0alpha1. Importing as sre deprecated in Python 2.5, only availabile as re in Python 3.x.
PyPI python-pcremostly ThirdPCRE(2nd)pcre_pcreExtension binding by Arkadiusz Wahlig. Uses the third API except for substitution format string syntax, and can be configured to use the third-API syntax there too. Lacks the scanner APIs and DEBUG and LOCALE flags of the third API. Current PCRE does support Unicode regular expressions; note the name collision.
Planned for future inclusion; PyPI regexThird with extensionsSecretLabs based(2nd)regex_regex_regex_coreExtension by Matthew Barnett, forked from re (sre). Prominent enough to get a mention in the documentation and in principle approval for eventual stdlib inclusion”. Note the name collision with the second API. Backward-incompatibile behaviour fixes behind a version switch selectable in regex syntax and in API.

† Python 1.6 is basically the state of Python 2 at the point that Guido left CNRI, released under contractual obligation or something similar: it incorporates many but not all distinctively 2.x features, it is accordingly not a true Python 1.x release; hence, What’s new in Python 2.0” compares it with Python 1.5.2.