
AMDG M wrote:
In: http://www.boost.org/doc/libs/1_37_0/doc/html/string_algo/usage.html#id36769...
there is an example: Find Iterator
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = string str1("abc-*-ABC-*-aBc"); // Find all 'abc' substrings (ignoring the case) // Create a find_iterator typedef find_iteratorstring::iterator string_find_iterator; for(string_find_iterator It= make_find_iterator(str1, first_finder("abc", is_iequal())); It!=string_find_iterator(); ++It) { cout << copy_rangestd::string(*It) << endl; }
// Output will be: // abc // ABC // aBC = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
how do i find the position of each "abc" in: str1 ?
Inside the loop, It->begin() is a std::string::iterator to the beginning of the current match. In Christ, Steven Watanabe