Splitting with Regular Expressions

Fredrik Lundh fredrik at pythonware.com
Fri Mar 18 21:07:02 CET 2005


"qwweeeit" <qwweeeit at yahoo.it> wrote:

> In fact I am implementing a cross-reference tool  and working on
> python sources, I don't need the '.' as separator in order to capture
> variables and commands.

if you're parsing Python source code, consider using the tokenize module:

    http://docs.python.org/lib/module-tokenize.html

if you don't have to support "broken" source code, the parse module may
be even more useful:

    http://docs.python.org/lib/module-parser.html

for simpler cases, the "class browser" parser may be an even better choice:

    http://docs.python.org/lib/module-pyclbr.html

</F> 






More information about the Python-list mailing list