You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-dev@jakarta.apache.org by Ian Swett <is...@ispheres.com> on 2001/04/11 22:37:47 UTC
StackOverflow Error
Is there anyway to prevent StackOverflow Errors with large files?
Particularly, I have problems with the following:
matching "start (.|\E)*" against any file with "start" towards the
beginning, and the StackOverflow Error occurs if the file is long enough.
Is there an easier/more efficient way to get everything in the file, or
everthing until an ending phrase "end"? Or is this a fundamental flaw
with the recursive nature of the code?
Sorry if this is somewhat of a usage question, but I'm concerned it may be
a problem with the code itself.
BTW, I did start working on the ability to collect the locations of
multiple matches for a * operator, and it works in most cases, but has
some bugs. If anyone else really needs this, I'd be happy to hurry up and
finish. Otherwise, it'll wait until I really need it.
Ian
Re: StackOverflow Error
Posted by Ian Swett <is...@ispheres.com>.
Sorry, I meant (.|\n)*.
Ian
Re: StackOverflow Error
Posted by Michael McCallum <mi...@spinsoftware.com>.
On 11 Apr 2001, at 13:37, Ian Swett wrote:
> Is there anyway to prevent StackOverflow Errors with large files?
>
> Particularly, I have problems with the following:
>
> matching "start (.|\E)*" against any file with "start" towards the
> beginning, and the StackOverflow Error occurs if the file is long enough.
> Is there an easier/more efficient way to get everything in the file, or
> everthing until an ending phrase "end"? Or is this a fundamental flaw
> with the recursive nature of the code?
>
> Sorry if this is somewhat of a usage question, but I'm concerned it may be
> a problem with the code itself.
>
> BTW, I did start working on the ability to collect the locations of
> multiple matches for a * operator, and it works in most cases, but has
> some bugs. If anyone else really needs this, I'd be happy to hurry up and
> finish. Otherwise, it'll wait until I really need it.
>
> Ian
>
The problem is that the whole file is being examined.
You could always set -Xms=BIGVALUE
I have a few ideas on how to work around that though.
Submit patches for what you are doing then you can have input from other people. :)
Michael