Re: [Tutor] searching for newlines does not work!

2010-10-23 Thread win...@interchange.ubc.ca
(Hope this reply makes it back to the Tutor list; I didn't see how the list would know this is a reply... I'm trying a reply-all) This is where I say Doh! and Thanks! I realize now where my fuzzy-headedness come from. I generally use re expressions. If these were re search strings, the raw would

Re: [Tutor] searching for newlines does not work!

2010-10-23 Thread Alan Gauld
"Adam Bark" wrote >>> test=r"a \n b \n c \n" >>> test.replace(r"\n","***") 'a *** b *** c ***' >>> test2=""" ... a ... b ... c ... """ >>> test2.replace(r"\n","***") '\na\nb\nc\n' In your first example you put the characters into the string test and replaced the characters. The second exam

Re: [Tutor] searching for newlines does not work!

2010-10-23 Thread Adam Bark
On 23/10/10 23:03, win...@interchange.ubc.ca wrote: This is driving me batty! In the interactive window, I can use string.replace on newlines for some strings and not for others. Here is what work for newlines: b...@bill-laptop:~$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC

[Tutor] searching for newlines does not work!

2010-10-23 Thread win...@interchange.ubc.ca
This is driving me batty! In the interactive window, I can use string.replace on newlines for some strings and not for others. Here is what work for newlines: b...@bill-laptop:~$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or