Re: re Insanity

2005-01-26 Thread Tim Daneliuk
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

Re: re Insanity

2005-01-25 Thread Aahz
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

Re: re Insanity

2005-01-23 Thread Tim Daneliuk
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

Re: re Insanity

2005-01-23 Thread Orlando Vazquez
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

Re: re Insanity

2005-01-22 Thread Duncan Booth
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