Hello, Easiest solution would be to use regular expression. You can use Boost.Regex library directly or you can use the wrappers provided in Boost.StringAlgo. Alternatively, you can define your own "finder" that will lookup expressions bracketed in {}s. And then pass it the generic find_format_all algorithm. Links: http://www.boost.org/doc/html/string_algo/concept.html#string_algo.finder_co... http://www.boost.org/doc/html/boost/algorithm/find_format_all.html http://www.boost.org/doc/html/string_algo/reference.html#header.boost.algori... Best Regards, Pavol. Jeff Wang wrote:
Hello, I have a string "abc{123}de{456}fghijk{789}", and I want to find the content within all the { }s, and replace them with other string, I thought it is easy to realize this with string algorithm, but can not figure out, could anyone help? Thanks
____________________________________________________________________________________ The fish are biting. Get more visitors on your site using Yahoo! Search Marketing. http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users