Hi all,

using the "re" module of Python (2.3 and 2.4), I tried the following:

  import re
  print re.sub('X.*?Y', 'Z', 'Xab\ncdY', re.DOTALL)

I wanted to replace
   Xab
   cdY
by a single "Z", but the "." in the pattern does not match the 
included "\n".

When using the pattern "X(.|\n)*?Y" (explicity including "\n"
in the set of "any character") I get the wanted result.

My fault or a bug in the module?

Thanks
-stefan-

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to