On Wed, 22 Jun 2005, Shidan wrote:
> Hi I have a list of regular expression patterns like such:
>
> thelist = ['^594694.*','^689.*','^241.*',
>'^241(0[3-9]|1[0145]|2[0-9]|3[0-9]|41|5[1-37]|6[138]|75|8[014579]).*']
> >
> Now I want to iterate thru each of these like:
>
> for pattern in thelis
> for pattern in thelist:
>regex=re.compile(pattern)
>if regex.match('24110'):
>the_pattern = pattern
>.
>.
>sys.exit(0)
>
> but in this case it will pick thelist[2] and not the list[3] as I
wanted to,
> how can I have it pick the pattern that describes it be
Hi Shidan!
on Wed, 22 Jun 2005 00:28:44 -0400 Shidan <[EMAIL PROTECTED]> wrote :
-
Shidan > Hi I have a list of regular expression patterns like such:
Shidan >
Shidan > thelist =
['^594694.*','^689.*','
Hi I have a list of regular expression patterns like such:
thelist =
['^594694.*','^689.*','^241.*','^241(0[3-9]|1[0145]|2[0-9]|3[0-9]|41|5[1-37]|6[138]|75|8[014579]).*']
Now I want to iterate thru each of these like:
for pattern in thelist:
regex=re.compile(pattern)
if regex.match('24