[EMAIL PROTECTED] wrote:
multipleSpaces = re.compile(u'\\h+')
importantTextString = '\n \n \n \t\t '
importantTextString = multipleSpaces.sub("M", importantTextString)
what's "\\h" supposed to mean?
I would have expected consecutive spaces and tabs to be replaced by M
but nothing is being replaced.
if you know what you want to replace, be explicit:
>>> importantTextString = '\n \n \n \t\t '
>>> re.compile("[\t ]+").sub("M", importantTextString)
'\nM\nM\nM'
</F>
--
http://mail.python.org/mailman/listinfo/python-list