本文整理汇总了C++中match_results::prefix方法的典型用法代码示例。如果您正苦于以下问题:C++ match_results::prefix方法的具体用法?C++ match_results::prefix怎么用?C++ match_results::prefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类match_results
的用法示例。
在下文中一共展示了match_results::prefix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: next
bool next()
{
if(N == -1)
return false;
if(N+1 < (int)subs.size())
{
++N;
result =((subs[N] == -1) ? what.prefix() : what[subs[N]]);
return true;
}
//if(what.prefix().first != what[0].second)
// flags |= /*match_prev_avail |*/ regex_constants::match_not_bob;
BidirectionalIterator last_end(what[0].second);
if(regex_search(last_end, end, what, re, ((what[0].first == what[0].second) ? flags | regex_constants::match_not_initial_null : flags), base))
{
N =0;
result =((subs[N] == -1) ? what.prefix() : what[subs[N]]);
return true;
}
else if((last_end != end) && (subs[0] == -1))
{
N =-1;
result.first = last_end;
result.second = end;
result.matched = (last_end != end);
return true;
}
return false;
}
示例2: next
bool next()
{
if(what.prefix().first != what[0].second)
flags |= match_prev_avail;
BidirectionalIterator next_start = what[0].second;
match_flag_type f(flags);
if(!what.length())
f |= regex_constants::match_not_initial_null;
bool result = regex_search(next_start, end, what, *pre, f);
if(result)
what.set_base(base);
return result;
}
示例3: init
bool init(BidirectionalIterator first)
{
N = 0;
if(regex_search(first, end, what, re, flags) == true)
{
N = 0;
result = ((subs[N] == -1) ? what.prefix() : what[(int)subs[N]]);
return true;
}
else if((subs[N] == -1) && (first != end))
{
result.first = first;
result.second = end;
result.matched = (first != end);
return true;
}
return false;
}