[Python-ideas] Support parsing stream with `re`

Ram Rachum ram at rachum.com
Sat Oct 6 04:32:48 EDT 2018

It'll load as much as it needs to in order to match or rule out a match on
a pattern. If you'd try to match `a.*b` it'll load the whole thing. The use
cases that are relevant to a stream wouldn't have these kinds of problems.

On Sat, Oct 6, 2018 at 11:22 AM Serhiy Storchaka <storchaka at gmail.com>

> 06.10.18 10:22, Ram Rachum пише:
> > I'd like to use the re module to parse a long text file, 1GB in size. I
> > wish that the re module could parse a stream, so I wouldn't have to load
> > the whole thing into memory. I'd like to iterate over matches from the
> > stream without keeping the old matches and input in RAM.
> How would you match 'a.*b' without loading the whole thing into memory?
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20181006/fba8f4b3/attachment.html>

More information about the Python-ideas mailing list