Aahz wrote:
In article <[EMAIL PROTECTED]>,
Tim Daneliuk <[EMAIL PROTECTED]> wrote:
Given an arbitrary string, I want to find each individual instance of
text in the form: "[PROMPT:optional text]"
I tried this:
y=re.compile(r'\[PROMPT:.*\]')
Which works fine when the text is exactly "[PROMPT:w
In article <[EMAIL PROTECTED]>,
Tim Daneliuk <[EMAIL PROTECTED]> wrote:
>
>Given an arbitrary string, I want to find each individual instance of
>text in the form: "[PROMPT:optional text]"
>
>I tried this:
>
> y=re.compile(r'\[PROMPT:.*\]')
>
>Which works fine when the text is exactly "[PROMP
Fredrik Lundh wrote:
Tim Daneliuk wrote:
Thanks - very helpful. One followup - your re works as advertised. But
if I use: r'\[PROMPT:[^]].*\]' it seems not to. the '.*' instead of just '*'
it matches the entire string ...
it's not "just '*'", it's "[^]]*". it's the "^]" set (anything but ])
Orlando Vazquez wrote:
Tim Daneliuk wrote:
For some reason, I am having the hardest time doing something that should
be obvious. (Note time of posting ;)
Given an arbitrary string, I want to find each individual instance of
text in the form: "[PROMPT:optional text]"
I tried this:
y=re.compile
Tim Daneliuk wrote:
> Thanks - very helpful. One followup - your re works as advertised. But
> if I use: r'\[PROMPT:[^]].*\]' it seems not to. the '.*' instead of just '*'
> it matches the entire string ...
it's not "just '*'", it's "[^]]*". it's the "^]" set (anything but ]) that's
repeate
Tim Daneliuk wrote:
For some reason, I am having the hardest time doing something that should
be obvious. (Note time of posting ;)
Given an arbitrary string, I want to find each individual instance of
text in the form: "[PROMPT:optional text]"
I tried this:
y=re.compile(r'\[PROMPT:.*\]')
Whic
Fredrik Lundh wrote:
Tim Daneliuk wrote:
Given an arbitrary string, I want to find each individual instance of
text in the form: "[PROMPT:optional text]"
I tried this:
y=re.compile(r'\[PROMPT:.*\]')
Which works fine when the text is exactly "[PROMPT:whatever]"
didn't you leave something out h
Tim Daneliuk wrote:
>
> I tried this:
>
> y=re.compile(r'\[PROMPT:.*\]')
>
> Which works fine when the text is exactly "[PROMPT:whatever]" but
> does not match on:
>
> "something [PROMPT:foo] something [PROMPT:bar] something ..."
>
> The overall goal is to identify the beginning and
Tim Daneliuk wrote:
> Given an arbitrary string, I want to find each individual instance of
> text in the form: "[PROMPT:optional text]"
>
> I tried this:
>
> y=re.compile(r'\[PROMPT:.*\]')
>
> Which works fine when the text is exactly "[PROMPT:whatever]"
didn't you leave something out here?
For some reason, I am having the hardest time doing something that should
be obvious. (Note time of posting ;)
Given an arbitrary string, I want to find each individual instance of
text in the form: "[PROMPT:optional text]"
I tried this:
y=re.compile(r'\[PROMPT:.*\]')
Which works fine when th
10 matches
Mail list logo