Python not that wierd

Alex Martelli alex at magenta.com
Wed Aug 2 03:27:58 EDT 2000


"Cliff Crawford" <cjc26 at nospam.cornell.edu> wrote in message
news:slrn8of1sr.1co1.cjc26 at synecdoche.sowrong.org...
> * Alex Martelli <alex at magenta.com> menulis:
> |
> | I.e., I suspect a more efficacious R.E. for your match might be:
> |     if not self.compiled_re:
> |         self.compiled_re = re.compile(r'(\d*)[dD](\d*)([-+]\d+)?$')
> |     diematch = re.match(self.compiled_re,self.diecode)
>
> Oops, that should be
>
>       diematch = self.compiled_re.match(self.diecode)
>
> re.match only takes strings for its pattern argument, not compiled
> regexps.

Right, thanks -- serves me right for not testing!


Alex






More information about the Python-list mailing list