Created
February 20, 2019 02:53
-
-
Save ox1111/1597a1ad2b46e07e30facb6d60e20f45 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <boost/algorithm/string.hpp> | |
| #include <iostream> | |
| using namespace std; | |
| using namespace boost; | |
| int main( int argc , char ** argv ) | |
| { | |
| string str1 = "hello black falcon ab-*-AB-*-aB"; | |
| typedef find_iterator<string::iterator> string_find_it; | |
| string_find_it find_it; | |
| for( find_it = make_find_iterator(str1, first_finder("ab", is_iequal())); | |
| find_it != string_find_it(); | |
| find_it++) | |
| { | |
| cout << copy_range<std::string>(*find_it) << endl; | |
| } | |
| typedef split_iterator< string::iterator > string_split_it; | |
| string_split_it split_it; | |
| for( split_it = make_split_iterator(str1, first_finder("-*-", is_iequal())); | |
| split_it != string_split_it(); | |
| split_it++) | |
| { | |
| cout << copy_range<std::string>(*split_it) << endl; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment