Useful RE patterns
Pekka Niiranen
krissepu at vip.fi
Tue Jul 2 09:51:13 EDT 2002
I would make the following changes to sre:
1) findall() does not return empty matches
2) function to return nested structures .ie. recursive decent parser. Have a look
of egenix's mail list on June
-pekka-
Michael Hudson wrote:
> Norman Shelley <Norman_Shelley-RRDN60 at email.sps.mot.com> writes:
>
> > Fredrik Lundh wrote:
> >
> > > ...
> > > If I were to add a dozen (or so) patterns to the (S)RE module,
> > > what should I pick? What patterns do you find yourself using
> > > over and over again?
> >
> > All kinds of numerics, e.g. scientific (1e-6, 2e6, ...) and engineering (1u,
> > 2M and/or 2MEG, ...) notation.
> >
> > Python identifiers as previously mentioned.
>
> Well, *they're* already in the tokenize module.
>
> Cheers,
> M.
>
> --
> That's why the smartest companies use Common Lisp, but lie about it
> so all their competitors think Lisp is slow and C++ is fast. (This
> rumor has, however, gotten a little out of hand. :)
> -- Erik Naggum, comp.lang.lisp
More information about the Python-list
mailing list