Boost logo

Boost Users :

From: John Maddock (jz.maddock_at_[hidden])
Date: 2008-06-14 04:02:59


Per Franck wrote:
> Hello All.
>
> I'm using the C++ library of boost RegEx. Long story short: I'm trying
> the expression
>
> (?<=<h1>).*?(?=</h1>)
>
> On the string <h1>hello there</h1>
>
> and the engine crashes (asserts in Kernel32(d).dll)
>
> Is this a known issue?
>
> here's my code snippet.
>
> std::vector<std::string> v;
> boost::RegEx expr( "<h1>hello there</h1>", TRUE);
> expr.Grep(v, "(?<=<h1>).*?(?=</h1>)" );

Runs just fine for me here with VC8:

* What compiler are you using?
* Are you letting Boost.Regex auto-select the correct library variant to
link against? These kinds of issues are usually caused by selecting a
binary-incompatible library variant.

And finally... you have the strings the wrong way around, that should be:

  std::vector<std::string> v;
  boost::RegEx expr("(?<=<h1>).*?(?=</h1>)", TRUE);
  expr.Grep(v, "<h1>hello there</h1>" );

HTH, 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