When I search & replace with regular expressions, I sometimes get the error: "Recursion too deep; the stack overflowed." It usually happens when I work with large files with long lines (30,000+ bytes per line).
Does Textpad have a limit to how large files can be, or is this a problem with Windows/my PC's memory?
Stack overflow error
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
Stephan
Re: Stack overflow error
We probably need an example of the RegEx you use.
You can easily make a RegEx consume _huge_ amounts of memory, if the RegEx is statet, er, less than optimal.
With complex regular expression you can get into very deep recurions levels when the RegEx 'backtracks' a lot. This is the case if there are stars *, pluses + and their friends included.
Then every time a Regex part following such a special character forces this special cahr to give up a char (one at a time) and tries again to mach. (Yes, it's relatively complex...)
Now imagine there are some '*'s (or the like) nested...
Did That help? I really hope so.
You can easily make a RegEx consume _huge_ amounts of memory, if the RegEx is statet, er, less than optimal.
With complex regular expression you can get into very deep recurions levels when the RegEx 'backtracks' a lot. This is the case if there are stars *, pluses + and their friends included.
Then every time a Regex part following such a special character forces this special cahr to give up a char (one at a time) and tries again to mach. (Yes, it's relatively complex...)
Now imagine there are some '*'s (or the like) nested...
Did That help? I really hope so.
-
scribe
Re: Stack overflow error
Thanks, that sort of helps... I'm using regular expressions to swap things around, e.g.:
^([^<]+)(<marker>)(.+)$
\3\2\1
If I had more RAM would the error pop up less often?
Thanks again
^([^<]+)(<marker>)(.+)$
\3\2\1
If I had more RAM would the error pop up less often?
Thanks again