bug: string.find() doesn't cross newlines 
Author Message
 bug: string.find() doesn't cross newlines

Was this intended?

Python 1.2 (Jun 19 1995)
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam

Quote:
>>> t1 = 'foo\nbar'
>>> t1
'foo\012bar'
>>> import string
>>> string.find("bar", t1)
-1



Sat, 31 Jan 1998 03:00:00 GMT  
 bug: string.find() doesn't cross newlines
Excerpts from direct: 14-Aug-95 Re: bug: string.find() doe.. Andrew

Quote:
>    Good day!

> > >>> string.find("bar", t1)
> > -1
>    Ooh, bet you'll get a full mailbox for this...  
>    Try string.find(t1, 'bar'); it returns 4.  
>    Andrew Kuchling


Ouch!  Thanks.

Bill



Sat, 31 Jan 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. finding newline chars in string?

2. string.replace() can't replace newline characters???

3. $canvas find enclosed does not find text with trailing newline

4. I can't find my bug report in the Scriptics Bug DB.

5. finding '(' in string with gawk

6. CW4: doesn't find exe after run

7. Doesn't find System Exec.vi

8. LabView doesn't find file

9. ruby -n -e doesn't find things ...

10. g77 and gdb doesn't find uninitialized variables

11. ODBC/MS Access Doesn't Find Tables

12. found font-lock, doesn't work...

 

 
Powered by phpBB® Forum Software