[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: python regex: misbehaviour with "\r" (0x0D) as Newline character in Unicode Mode

Fredrik Lundh

1/27/2008 6:27:00 PM

Arian Sanusi wrote:

> concerning to unicode, "\n", "\r "and "\r\n" (0x000A, 0x000D and
0x000D+0x000A) should be threatened as newline character

the link says that your application should treat them line terminators,
not that they should all be equal to a new line character.

to split on Unicode line endings, use the splitlines method. for the
specific characters you mention, you can also read the file in universal
mode.

</F>