"cheng" <[EMAIL PROTECTED]> wrote:

> >>> p.sub('','a\nbc')
> 'abc'
> >>> p.sub('','%s') % "a\nbc"
> 'a\nbc'
>
> is it anyone got some idea why it happen?

>>> p.sub('', 'a\nbc')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'p' is not defined

>>> import re
>>> p = re.compile("\n*")
>>> p.sub("", "a\nbc")
'abc'
>>> p.sub("", "%s")
'%s'

</F>



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

Reply via email to