|
Boost Users : |
Subject: [Boost-users] [Regex] Subexpression matching during search
From: Larry (lknain_at_[hidden])
Date: 2014-01-02 16:40:55
I have probably missed something in the doc that answers my query but I just canât see it.
This is using Perl syntax.
I had a regex:
^(XXX_\d{3,3})_\d{3,3}$
It compiles OK but does not match anything in a regex_search. If I remove the parenthesis
^XXX_\d{3,3}_\d{3,3}$
I get matches. Any clues as to what I am missing?
Extract of regex related code lines:
reg.regex = new boost::regex(reg.reg,boost::regex::perl | boost::regex::icase);
boost::match_results<string::const_iterator> match;
boost::match_flag_type flags = boost::match_default;
std::string::const_iterator xstart, xend;
xrc = boost::regex_search(xstart,xend,match,*((*rgi).regex),flags);
Larry
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