On Jul 4, 7:15 am, Matthieu TC <[EMAIL PROTECTED]> wrote:
> May I suggest giving the possibility to use any delimiter for a raw string?
> just like in Vi or ruby.
>
> Vi:
> %s_a_b_g is valid and so is %s/a/b/g
>
> Ruby:
> %q{dj'\ks'a\'"} or %q-dj'\ks'a\'"-
>
> So as long as your regex does
Yeah, that's a good point...
On Jul 8, 2007, at 1:48 AM, Tim Roberts wrote:
> i3dmaster <[EMAIL PROTECTED]> wrote:
>>
>> Then you can use other chars as the delimiter, [EMAIL PROTECTED]@b@ or
>> r!a!b!,
>> etc... The import thing is so long as the interpreter doesn't get
>> confused on the data
i3dmaster <[EMAIL PROTECTED]> wrote:
>
>Then you can use other chars as the delimiter, [EMAIL PROTECTED]@b@ or r!a!b!,
>
>etc... The import thing is so long as the interpreter doesn't get
>confused on the data and the delimiter.
That limits the number of valid delimiters to a relatively small
Then you can use other chars as the delimiter, [EMAIL PROTECTED]@b@ or r!a!b!,
etc... The import thing is so long as the interpreter doesn't get
confused on the data and the delimiter. sed also allows for
arbitrary delimiters too as long as you maintain the integrity of the
original meanin
Matthieu TC <[EMAIL PROTECTED]> wrote:
>May I suggest giving the possibility to use any delimiter for a raw string?
>just like in Vi or ruby.
>
>Vi:
> %s_a_b_g is valid and so is %s/a/b/g
>
>Ruby:
> %q{dj'\ks'a\'"} or %q-dj'\ks'a\'"-
>
>So as long as your regex does not use all the valid cha
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Wed, 04 Jul 2007 11:21:14 +, Neil Cerutti wrote:
>
> > If the escaped quotes didn't function in raw strings, I'd be
> > unable to construct (with a single notation) a regex that
> > included both kinds of quotes at once.
> >
> > re.c
On 2007-07-04, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-07-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> On Wed, 04 Jul 2007 11:21:14 +, Neil Cerutti wrote:
>>
>>> If the escaped quotes didn't function in raw strings, I'd be
>>> unable to construct (with a single notation)
On 2007-07-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Wed, 04 Jul 2007 11:21:14 +, Neil Cerutti wrote:
>
>> If the escaped quotes didn't function in raw strings, I'd be
>> unable to construct (with a single notation) a regex that
>> included both kinds of quotes at once.
>>
>
Matthieu TC wrote:
> May I suggest giving the possibility to use any delimiter for a raw string?
> just like in Vi or ruby.
>
Of course you may. Thank you for your suggestion.
Now, on to other business.
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC/Lt
cters, readability is
maintained.
-matt
- Original Message
From: Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]>
To: python-list@python.org
Sent: Wednesday, July 4, 2007 9:27:46 PM
Subject: Re: what is wrong with that r"\"
On Wed, 04 Jul 2007 11:21:14 +, Neil Ceru
Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> Does anyone know the justification for a)? Maybe we should remove it
> in py3k?
>
I think at least part of the justification is that it keeps the grammar
simple. The tokenising happens identically irrespective of any modifiers.
The r modifier doesn
On Wed, 04 Jul 2007 11:21:14 +, Neil Cerutti wrote:
> If the escaped quotes didn't function in raw strings, I'd be
> unable to construct (with a single notation) a regex that
> included both kinds of quotes at once.
>
> re.compile(r"'\"")
Where's the problem!? ::
re.compile(r"''')
On 2007-07-04, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
>> String quotes can be escaped with a backslash, but the
>> backslash remains in the string; for example, r"\"" is a
>> valid string literal consisting of two characters: a
>> backslash and a double quote;
>
> a) That is wei
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On Jul 3, 7:15 am, alf <[EMAIL PROTECTED]> wrote:
> > question without words:
> >
> > >>> r"\"
> >File "", line 1
> > r"\"
> > ^
> > SyntaxError: EOL while scanning single-quoted string
> > >>> r"\ "
> > '\\ '
>
> One slash escape
Neil Cerutti <[EMAIL PROTECTED]> wrote:
> From the Python Language Reference 2.4.1 String Literals:
>
> When an "r" or "R" prefix is present, a character following a
> backslash is included in the string without change, and all
> backslashes are left in the string. For example, the st
On 2007-07-03, alf <[EMAIL PROTECTED]> wrote:
> question without words:
>
> >>> r"\"
>File "", line 1
> r"\"
> ^
> SyntaxError: EOL while scanning single-quoted string
> >>> r"\ "
> '\\ '
>From the Python Language Reference 2.4.1 String Literals:
When an "r" or "R" prefix is p
On Jul 3, 8:25 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> On Tue, 03 Jul 2007 06:16:43 -0700, [EMAIL PROTECTED] wrote:
> >On Jul 3, 7:15 am, alf <[EMAIL PROTECTED]> wrote:
> >> question without words:
>
> >> >>> r"\"
> >>File "", line 1
> >> r"\"
> >> ^
> >> SyntaxError:
On Tue, 03 Jul 2007 06:16:43 -0700, [EMAIL PROTECTED] wrote:
>On Jul 3, 7:15 am, alf <[EMAIL PROTECTED]> wrote:
>> question without words:
>>
>> >>> r"\"
>>File "", line 1
>> r"\"
>> ^
>> SyntaxError: EOL while scanning single-quoted string
>> >>> r"\ "
>> '\\ '
>
>One slash esca
On Jul 3, 7:15 am, alf <[EMAIL PROTECTED]> wrote:
> question without words:
>
> >>> r"\"
>File "", line 1
> r"\"
> ^
> SyntaxError: EOL while scanning single-quoted string
> >>> r"\ "
> '\\ '
One slash escapes the following character, so the proper way of
writing it is either
r
question without words:
>>> r"\"
File "", line 1
r"\"
^
SyntaxError: EOL while scanning single-quoted string
>>> r"\ "
'\\ '
--
http://mail.python.org/mailman/listinfo/python-list
20 matches
Mail list logo