How to use python regular expression to substitute string value

Crutcher crutcher at gmail.com
Sun Feb 26 14:39:41 EST 2006


Are you sure node.data contains newlines?
You could try just:
print node.data
print node.data.split('\n')

This should give you an idea. From the interpreter:
>>> s = """
... abc
... def
... xyz"""
>>> s.split('\n')
['', 'abc', 'def', 'xyz']




More information about the Python-list mailing list