Re: Matching zero only once using RE

2005-10-09 Thread Tim Roberts
Mike Meyer <[EMAIL PROTECTED]> wrote: > >I think it's time to form a Committee for the Prevention of Regular >Expression Abuse. As I learned from personal experience, this is a disease which one contracts when moving to Python from Perl. Perl teaches you that the entire world is a string, and eve

Re: Matching zero only once using RE

2005-10-07 Thread Fredrik Lundh
Mike Meyer wrote: > I think it's time to form a Committee for the Prevention of Regular > Expression Abuse. on the other hand, the RE engine uses a more advanced scanning algorithm than string find, which means that constant RE:s can in fact be faster under some circumstances (certain patterns, t

Re: Matching zero only once using RE

2005-10-07 Thread Aahz
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: > >I think it's time to form a Committee for the Prevention of Regular >Expression Abuse. 'Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.' --Jamie

Re: Matching zero only once using RE

2005-10-07 Thread GregM
Hi thanks to all of you. Mike I like your committee idea. where can I join? lol Greg. -- http://mail.python.org/mailman/listinfo/python-list

Re: Matching zero only once using RE

2005-10-07 Thread Mike Meyer
"GregM" <[EMAIL PROTECTED]> writes: > I've looked at a lot of pages on the net and still can't seem to nail > this. Would someone more knowledgeable in regular expressions please > provide some help to point out what I'm doing wrong? > > I am trying to see if a web page contains the exact text: > Y

Re: Matching zero only once using RE

2005-10-07 Thread Benji York
GregM wrote: > I am trying to see if a web page contains the exact text: > You have found 0 matches It is unclear to me why you're using a regex at all. If you want to find the *exact* text "You have found 0 matches" perhaps you should do something like this: if "You have found 0 matches" in p

Re: Matching zero only once using RE

2005-10-07 Thread Jaime Wyant
On 7 Oct 2005 10:35:22 -0700, GregM <[EMAIL PROTECTED]> wrote: > Hi, > > I've looked at a lot of pages on the net and still can't seem to nail > this. Would someone more knowledgeable in regular expressions please > provide some help to point out what I'm doing wrong? > > I am trying to see if a we