Re: Raw string fu

2005-11-21 Thread 'Dang' Daniel Griffith
On 26 Oct 2005 12:27:53 -0700, "Paul McGuire" <[EMAIL PROTECTED]> wrote: >"Raw string fu"? A new martial art? For the udon-aware. --dang -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw string fu

2005-10-26 Thread Paul McGuire
"Raw string fu"? A new martial art? -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw string fu

2005-10-26 Thread Fredrik Lundh
Joshua Ginsberg wrote: > >>> r'\' > File "", line 1 > r'\' > ^ > SyntaxError: EOL while scanning single-quoted string > >>> r'\\' > '' > > Does that seem wrong to anybody else? Shouldn't the first one be > syntactically correct? the "r" prefix doesn't change how string literals are parsed; it

Re: Raw string fu

2005-10-26 Thread Jaime Wyant
Doh. that example was supposed to be -> >>> r'I can\'t end strings with a \.' "I can\\'t end strings with a \\." On 10/26/05, Jaime Wyant <[EMAIL PROTECTED]> wrote: > This URL has a good section on raw strings. > > http://www.ferg.org/projects/python_gotchas.html > > r'\' is wrong because raw stri

Re: Raw string fu

2005-10-26 Thread Jaime Wyant
This URL has a good section on raw strings. http://www.ferg.org/projects/python_gotchas.html r'\' is wrong because raw strings were originally added to make regular expressions easier to write. And you can't have a regexp that ends with \. Also, you can use the \ to escape your original quote c

Raw string fu

2005-10-26 Thread Joshua Ginsberg
>>> r'\' File "", line 1 r'\' ^ SyntaxError: EOL while scanning single-quoted string >>> r'\\' '' Does that seem wrong to anybody else? Shouldn't the first one be syntactically correct? -jag -- http://mail.python.org/mailman/listinfo/python-list