You need to seek back the longest possible match (here 8) before reading the next chunk.
Actually the correct number is something like min ( p ,m )
With p = chunksize - pos
and m = length of longest possible match
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
In reply to Re^2: How to optimize a regex on a large file read line by line ?
by LanX
in thread How to optimize a regex on a large file read line by line ?
by John FENDER
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |