split large file by string/regex

Diez B. Roggisch deetsNOSPAM at web.de
Mon Nov 22 15:09:30 CET 2004

> Depends on your definition of "simple", I suppose. The problem with
> *not* using a lexer is that you'd have to examine the file in a sequence
> of overlapping chunks to make sure that a regex could pick up all
> matches. For me that would be more complex than using a lexer, given the
> excellent range of modules such as SPARK and PLY, to mention but two.

At least spark operates on whole strings if used as lexer/tokenizer - you
can of course feed it a lazy sequence of tokens by using a generator - but
that's up to you.


Diez B. Roggisch

More information about the Python-list mailing list