Boost logo

Boost Users :

From: Pavol Droba (droba_at_[hidden])
Date: 2007-06-10 11:14:00


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_concept
http://www.boost.org/doc/html/boost/algorithm/find_format_all.html
http://www.boost.org/doc/html/string_algo/reference.html#header.boost.algorithm.string_regex.hpp

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_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net