Boost logo

Boost Users :

From: John V. Sichi (jsichi_at_[hidden])
Date: 2005-08-16 11:07:09


Here's the output for my test code below:

jvs_at_bagheera:~/open/fennel/test$ BugTest
regex_match(without result): 1
regex_match(with result): 0

====

#include <boost/regex.hpp>
#include <iostream>

int main()
{
  boost::regex exp("a(bc)?");
  const char *value = "abcbc";

  bool result = boost::regex_match(value, value + 5, exp);
  std::cout << "regex_match(without result): " << result << std::endl;

  boost::match_results<char const *> results;
  result = boost::regex_match(value, value + 5, results, exp);
  std::cout << "regex_match(with result): " << result << std::endl;

  return 0;
}

====

jvs_at_bagheera:~/open/fennel/test$ g++ --version
g++ (GCC) 3.3.5 (Debian 1:3.3.5-8ubuntu2)

JVS

John Maddock wrote:
> I can't reproduce your problem here, here's the test code I'm using:
>
> #include <boost/regex.hpp>
> #include <iostream>
>
> int main()
> {
> boost::regex exp("a(bc)?");
> const char *value = "abcbc";
> bool result = boost::regex_match(value, value + 5, exp);
> return result;
> }
>
> 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