Python regular expression

Roberto Bonvallet Roberto.Bonvallet at cern.ch
Tue Dec 5 06:48:27 EST 2006


Wehrdamned wrote:
> As I understand it, python uses a pcre engine to work with regular
> expression.
[...]
> My question is, then, why expressions like :
>>>> re.compile('asd|(?-i:QWE)', re.I)
[...]
> don't work? They are ok in perl... 

>From http://docs.python.org/lib/module-re.html:

    This module provides regular expression matching operations
    *similar* to those found in Perl.

Similar != the same.  See http://docs.python.org/lib/re-syntax.html for
details about valid syntax for regular expressions in Python.

Cheers,
-- 
Roberto Bonvallet



More information about the Python-list mailing list