How best to write this if-else?

Mike C. Fletcher mcfletch at home.com
Mon Apr 23 11:49:40 EDT 2001


Hmm, what does Perl do when there's multiple threads using the same re
concurrently?  I think that's the major reason behind the matchobject
approach that arrived with the re module (the older regex module uses a
pattern similar to what you've described).

Enjoy,
Mike

-----Original Message-----
From: Harry George [mailto:hgg9140 at cola.ca.boeing.com]
Sent: Monday, April 23, 2001 09:46
To: python-list at python.org
Cc: nobody
Subject: Re: How best to write this if-else?
...
This allows the perlish idiom:

if p.m(regexpr_here,data_string_here):
    prematch=p.PREMATCH
    match=p.MATCH
    postmatch=p.POSTMATCH
    group1=p.S1    # S = $
    ....
...





More information about the Python-list mailing list