28 Feb
2007
28 Feb
'07
5:10 p.m.
Diego Molla wrote:
Hi,
I have a problem using the Boost regex library. I have isolated the problem to the attached piece of code. For some reason the output returned by the function that uses regex is garbage. I have tested the same program on a Linux version of boost and it works fine. I wonder if the problem is on the Windows installation. Could someone using Windows or Cygwin test this and tell me if it works?
There's at least one issue with your code, in: if (regex_search(what[1].str(),what,attrMarkup)) { the result of what[1].str() is a temporary string object: by the time the call returns the object has gone out of scope, and the iterators stored in "what" are invalid. HTH, John.