in reply to Possible to have regexes act on file directly (not in memory)

> Is it possible to let a regular expression act directly on a file without reading any part of the file to memory?

no, at least if you don't hack a Perl using the filesystem instead of RAM and hence running many magnitudes slower.

see also Re: Memory Leak when slurping files in a loop (sliding window explained) showing how a sliding window works.

You'll need a sliding window at least twice as big as the maximal expected match, (which should never be a problem.)

Cheers Rolf

( addicted to the Perl Programming Language)

  • Comment on Re: Possible to have regexes act on file directly (not in memory)