Stefan Palme wrote:
>> 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)
>> 
> Just noticed, that it works when *compiling* the pattern:
> 
>  import re
>  p = re.compile('X.*?Y', re.DOTALL)
>  print re.sub(p, 'Z', 'Xab\ncdY')
> 
> Still the question - my fault or a bug?

Your fault.  According to the documentation [1], the re.sub function takes
a count as a fourth argument, not the compilation flags.

[1] http://docs.python.org/lib/node46.html

Cheers,
-- 
Roberto Bonvallet
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to