Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2008-03-12 09:50:41


Dave DeLong wrote:
>> Ah, you're right. That was one of my attempts to fix it (which you
>> can guess didn't work).
>>
>> As for the inefficiency, this is my first stab at regex. =)
>>
>> Here's the complete function as it stands (or doesn't, since it still
>> crashes):
>>
>> void Page::removeScriptTags() {
>> boost::regex tagRegex("(?:i)<script[^>]*>.*?</script[^>]*>");
>> string source(*pageSource);
>> string replaced = boost::regex_replace(source, tagRegex, " ",
>> boost::match_default);
>> delete pageSource;
>> pageSource = new string(replaced);
>> }

That looks fine as it stands, but unless you can reduce it to a complete
test case that I can compile and run here it still doesn't help much. Also
what compiler, platform and Boost version are you using? Also please check
that there isn't some binary-compatibity issue going on: building your app
with different options than Boost was built with, or linking to a library
file that's from a different Boost version to the headers you're #including
etc...

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net