PDA

View Full Version : Replace In File - out of stack space


sanderd
03-28-2006, 11:36 AM
I get this message when trying to do a replace in file...

"Out of stack space, while attempting to match a regular expression."

What does this mean?

I am trying to replace a whole section of XML. In the example below I would be trying to replace the entire XMLNode section.

<XMLNode option option 2>
<InnerNode>
<InnerNode2>
</InnerNode2>
</InnerNode>
</XMLNode>

My Regular expression is the following
<XMLNode(.|\n)*XMLNode>

The only difference between this example and what I am doing is the size of the XML section.

kinook
03-28-2006, 01:07 PM
Please ZIP and send or post:
1) The info from Help | About | Install Info
2) The .bld file used to build
3) The file replacements are being made in

sanderd
03-29-2006, 10:44 AM
Here is the info you asked for.

Thanks

kinook
03-29-2006, 10:54 AM
Using

.*

instead of

(.|\n)*

works.

sanderd
03-29-2006, 11:19 AM
Indeed it does. Thanks.

By chance do you know why the other mehtod doesn't work and a stack problem occurs?

kinook
03-29-2006, 03:36 PM
I guess the regex engine is running into some internal limit with a large amount of text when processing that expression. This is the regex component used by that action:
http://boost.org/libs/regex/doc/index.html