forked from boostorg/regex
Changed to use new iterator typedefs.
[SVN r21161]
This commit is contained in:
@ -90,8 +90,8 @@ int main(int argc, const char** argv)
|
||||
std::ifstream fs(argv[i]);
|
||||
load_file(text, fs);
|
||||
// construct our iterators:
|
||||
boost::regex_iterator<std::string::const_iterator> m1(text.begin(), text.end(), expression);
|
||||
boost::regex_iterator<std::string::const_iterator> m2;
|
||||
boost::sregex_iterator m1(text.begin(), text.end(), expression);
|
||||
boost::sregex_iterator m2;
|
||||
std::for_each(m1, m2, ®ex_callback);
|
||||
// copy results:
|
||||
cout << class_index.size() << " matches found" << endl;
|
||||
|
@ -54,8 +54,8 @@ int main(int argc)
|
||||
s = "This is a string of tokens";
|
||||
|
||||
boost::regex re("\\s+");
|
||||
boost::regex_token_iterator<std::string::const_iterator> i(s.begin(), s.end(), re, -1);
|
||||
boost::regex_token_iterator<std::string::const_iterator> j;
|
||||
boost::sregex_token_iterator i(s.begin(), s.end(), re, -1);
|
||||
boost::sregex_token_iterator j;
|
||||
|
||||
unsigned count = 0;
|
||||
while(i != j)
|
||||
|
@ -53,9 +53,8 @@ int main(int argc, char** argv)
|
||||
s.erase();
|
||||
std::ifstream is(argv[i]);
|
||||
load_file(s, is);
|
||||
boost::regex_token_iterator<std::string::const_iterator>
|
||||
i(s.begin(), s.end(), e, 1);
|
||||
boost::regex_token_iterator<std::string::const_iterator> j;
|
||||
boost::sregex_token_iterator i(s.begin(), s.end(), e, 1);
|
||||
boost::sregex_token_iterator j;
|
||||
while(i != j)
|
||||
{
|
||||
std::cout << *i++ << std::endl;
|
||||
@ -73,9 +72,8 @@ int main(int argc, char** argv)
|
||||
std::ifstream is(argv[i]);
|
||||
load_file(s, is);
|
||||
const int subs[] = {1, 0,};
|
||||
boost::regex_token_iterator<std::string::const_iterator>
|
||||
i(s.begin(), s.end(), e, subs);
|
||||
boost::regex_token_iterator<std::string::const_iterator> j;
|
||||
boost::sregex_token_iterator i(s.begin(), s.end(), e, subs);
|
||||
boost::sregex_token_iterator j;
|
||||
while(i != j)
|
||||
{
|
||||
std::cout << *i++ << std::endl;
|
||||
|
Reference in New Issue
Block a user