36 #if BOOST_VERSION < 105600 43 shared_ptr<RegexBackrefManager> backrefManager,
46 , m_isExactMatch(isExactMatch)
54 m_componentRegex = boost::regex(
m_expr);
56 m_pseudoMatchers.clear();
57 m_pseudoMatchers.push_back(make_shared<RegexPseudoMatcher>());
60 m_pseudoMatchers.push_back(make_shared<RegexPseudoMatcher>());
76 BOOST_THROW_EXCEPTION(
Error(
"Non-exact component search is not supported yet"));
78 boost::smatch subResult;
79 std::string targetStr = name.
get(offset).
toUri();
80 if (boost::regex_match(targetStr, subResult, m_componentRegex)) {
82 m_pseudoMatchers[i]->resetMatchResult();
83 m_pseudoMatchers[i]->setMatchResult(subResult[i]);
Copyright (c) 2013-2017 Regents of the University of California.
bool match(const Name &name, size_t offset, size_t len=1) override
RegexComponentMatcher(const std::string &expr, shared_ptr< RegexBackrefManager > backrefManager, bool isExactMatch=true)
Create a RegexComponent matcher from expr.
shared_ptr< RegexBackrefManager > m_backrefManager
void toUri(std::ostream &os) const
Write *this to the output stream, escaping characters according to the NDN URI Scheme.
std::vector< name::Component > m_matchResult
Represents an absolute name.
static constexpr size_t BOOST_REGEXP_MARK_COUNT_CORRECTION
const Component & get(ssize_t i) const
Get the component at the given index.
void compile() override
Compile the regular expression to generate the more matchers when necessary.