re and escape character

Fredrik Lundh fredrik at pythonware.com
Fri Sep 16 07:51:22 EDT 2005


Sinan Nalkaya wrote:

> thats exactly what i want, how can i use DOTALL, by doing re.compile ?

there's always the manual:

    http://docs.python.org/lib/node114.html

    compile(pattern[, flags])

    Compile a regular expression pattern into a regular expression object,
    which can be used for matching using its match() and search() methods,
    described below.

    The expression's behaviour can be modified by specifying a flags value.

    /.../

    S
    DOTALL

    Make the "." special character match any character at all, including a
    newline; without this flag, "." will match anything except a newline.

    /.../

</F> 






More information about the Python-list mailing list