c++ - Xpressive >>= Operator -
i toying around boost xpressive , having trouble following snippet
#include <iostream> #include <string> #include <boost/xpressive/xpressive.hpp> using namespace std; using namespace boost::xpressive; int main() { string s("123"); sregex rex = _d; rex >>= _d; smatch what; regex_search(s, what, rex); cout << "match: " << what[0] << endl; return 0; } the result of running program match of 1 opposed expected 12. sregex::operator>>= have different meaning/use intuitively assumed? expecting yield sregex similar _d >> _d.
xpressive doesn't support >>= operator. fact code compiles @ considered bug. try:
rex = rex >> _d; however, building regex piecemeal make regex perform poorly.
Comments
Post a Comment