I can't get proper information in 'what' for a regex_search with match_partial.
Here's a little demo program:
================================
#include <cstring>
#include <iostream>
#include <boost/regex.hpp>
int main(int, char**)
{
boost::regex regex("<(/)?my:meta[^>]*>", boost::regex::extended);
char test[] = "<demo test/><my:meta";
boost::match_flag_type flags(boost::match_default | boost::match_partial);
boost::match_results<char*> what;
bool check = boost::regex_search(test, test + strlen(test), what, regex, flags);
std::cout << "test = " << test << ", test-start = " << (long) test << ", test-end = " << (long)test + strlen(test) << std::endl;
std::cout << "check = " << (check ? "match" : "mismatch") << std::endl;
if (check)
{
std::cout << "what[0].matched = " << (what[0].matched ? "full" : "partial") << " match" << std::endl;
std::cout << "what[0].first = " << (long) what[0].first << ", what[0].second = " << (long)what[0].second << std::endl;
}
return 0;
}
================================
The output:
================================
test = <demo test/><my:meta, test-start = 140733633399792, test-end = 140733633399812
check = match
what[0].matched = partial match
what[0].first = 140733633399812, what[0].second = 140733633399812
================================
Though there is a partial match, both what[0].first and what[0].second return the test-end value (end of buffer (excl.)).
But i need the correct positions for a buffer handling.
regards,
Frank