[Python-Dev] Should we move to replace re with regex?

Steven D'Aprano steve at pearwood.info
Sat Aug 27 03:54:26 CEST 2011


Ben Finney wrote:
> "M.-A. Lemburg" <mal at egenix.com> writes:

>> No, you tell them: "If you want Unicode 6 semantics, use regex, if
>> you're fine with Unicode 2.0/3.0 semantics, use re".
> 
> What do we say, then, to those who are unaware of the different
> semantics between those versions of Unicode, and want regular expression
> to “just work” in Python?
> 
> To which document can we direct them to understand what semantics they
> want?

Presumably, like all modules, both the re and the regex module will have 
their own individual pages in the library reference. As the newcomer, 
regex should include a discussion of differences between the two. This 
can then be quietly dropped once re becomes formally deprecated.

(Assuming that the std lib keeps re and regex in parallel for a few 
releases, which is not a given.)

However, I note that last time, the old regex module was just documented 
as obsolete with little detailed discussion of the differences:

http://docs.python.org/release/1.5/lib/node69.html#SECTION005300000000000000000


-- 
Steven


More information about the Python-Dev mailing list