
Here's the output for my test code below: jvs@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@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.