Python and regex special considerations

In this section, we will review differences with other flavors, how to deal with Unicode, and also differences in the re module between Python 2.x and Python 3.

Differences between Python and other flavors

As we mentioned at the beginning of the book, the re module has Perl-style regular expressions. However, that doesn't mean Python support every feature the Perl engine has.

There are too many differences to cover them in a short book like this, if you want to know them in-depth here you have two good places to start:

Unicode

When you're using Python 2.x and you want to match Unicode, the regex ...

Get Mastering Python Regular Expressions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.